open-consul/proto/pbconnect/connect.gen.go
Dhia Ayachi 5cb24b9bf8
split pbcommon to pbcommon and pbcommongogo (#12587)
* mogify needed pbcommon structs

* mogify needed pbconnect structs

* fix compilation errors and make config_translate_test pass

* add missing file

* remove redundant oss func declaration

* fix EnterpriseMeta to copy the right data for enterprise

* rename pbcommon package to pbcommongogo

* regenerate proto and mog files

* add missing mog files

* add pbcommon package

* pbcommon no mog

* fix enterprise meta code generation

* fix enterprise meta code generation (pbcommongogo)

* fix mog generation for gogo

* use `protoc-go-inject-tag` to inject tags

* rename proto package

* pbcommon no mog

* use `protoc-go-inject-tag` to inject tags

* add non gogo proto to make file

* fix proto get
2022-03-22 16:30:00 -04:00

117 lines
3.2 KiB
Go

// Code generated by mog. DO NOT EDIT.
package pbconnect
import "github.com/hashicorp/consul/agent/structs"
func CARootToStructsCARoot(s *CARoot, t *structs.CARoot) {
if s == nil {
return
}
t.ID = s.ID
t.Name = s.Name
t.SerialNumber = s.SerialNumber
t.SigningKeyID = s.SigningKeyID
t.ExternalTrustDomain = s.ExternalTrustDomain
t.NotBefore = structs.TimeFromProtoGogo(s.NotBefore)
t.NotAfter = structs.TimeFromProtoGogo(s.NotAfter)
t.RootCert = s.RootCert
t.IntermediateCerts = s.IntermediateCerts
t.SigningCert = s.SigningCert
t.SigningKey = s.SigningKey
t.Active = s.Active
t.RotatedOutAt = structs.TimeFromProtoGogo(s.RotatedOutAt)
t.PrivateKeyType = s.PrivateKeyType
t.PrivateKeyBits = int(s.PrivateKeyBits)
t.RaftIndex = RaftIndexTo(s.RaftIndex)
}
func CARootFromStructsCARoot(t *structs.CARoot, s *CARoot) {
if s == nil {
return
}
s.ID = t.ID
s.Name = t.Name
s.SerialNumber = t.SerialNumber
s.SigningKeyID = t.SigningKeyID
s.ExternalTrustDomain = t.ExternalTrustDomain
s.NotBefore = structs.TimeToProtoGogo(t.NotBefore)
s.NotAfter = structs.TimeToProtoGogo(t.NotAfter)
s.RootCert = t.RootCert
s.IntermediateCerts = t.IntermediateCerts
s.SigningCert = t.SigningCert
s.SigningKey = t.SigningKey
s.Active = t.Active
s.RotatedOutAt = structs.TimeToProtoGogo(t.RotatedOutAt)
s.PrivateKeyType = t.PrivateKeyType
s.PrivateKeyBits = int32(t.PrivateKeyBits)
s.RaftIndex = RaftIndexFrom(t.RaftIndex)
}
func CARootsToStructsIndexedCARoots(s *CARoots, t *structs.IndexedCARoots) {
if s == nil {
return
}
t.ActiveRootID = s.ActiveRootID
t.TrustDomain = s.TrustDomain
{
t.Roots = make([]*structs.CARoot, len(s.Roots))
for i := range s.Roots {
if s.Roots[i] != nil {
var x structs.CARoot
CARootToStructsCARoot(s.Roots[i], &x)
t.Roots[i] = &x
}
}
}
t.QueryMeta = QueryMetaTo(s.QueryMeta)
}
func CARootsFromStructsIndexedCARoots(t *structs.IndexedCARoots, s *CARoots) {
if s == nil {
return
}
s.ActiveRootID = t.ActiveRootID
s.TrustDomain = t.TrustDomain
{
s.Roots = make([]*CARoot, len(t.Roots))
for i := range t.Roots {
if t.Roots[i] != nil {
var x CARoot
CARootFromStructsCARoot(t.Roots[i], &x)
s.Roots[i] = &x
}
}
}
s.QueryMeta = QueryMetaFrom(t.QueryMeta)
}
func IssuedCertToStructsIssuedCert(s *IssuedCert, t *structs.IssuedCert) {
if s == nil {
return
}
t.SerialNumber = s.SerialNumber
t.CertPEM = s.CertPEM
t.PrivateKeyPEM = s.PrivateKeyPEM
t.Service = s.Service
t.ServiceURI = s.ServiceURI
t.Agent = s.Agent
t.AgentURI = s.AgentURI
t.ValidAfter = structs.TimeFromProtoGogo(s.ValidAfter)
t.ValidBefore = structs.TimeFromProtoGogo(s.ValidBefore)
t.EnterpriseMeta = EnterpriseMetaTo(s.EnterpriseMeta)
t.RaftIndex = RaftIndexTo(s.RaftIndex)
}
func IssuedCertFromStructsIssuedCert(t *structs.IssuedCert, s *IssuedCert) {
if s == nil {
return
}
s.SerialNumber = t.SerialNumber
s.CertPEM = t.CertPEM
s.PrivateKeyPEM = t.PrivateKeyPEM
s.Service = t.Service
s.ServiceURI = t.ServiceURI
s.Agent = t.Agent
s.AgentURI = t.AgentURI
s.ValidAfter = structs.TimeToProtoGogo(t.ValidAfter)
s.ValidBefore = structs.TimeToProtoGogo(t.ValidBefore)
s.EnterpriseMeta = EnterpriseMetaFrom(t.EnterpriseMeta)
s.RaftIndex = RaftIndexFrom(t.RaftIndex)
}