mirror of https://github.com/status-im/consul.git
71 lines
2.0 KiB
Go
71 lines
2.0 KiB
Go
// Code generated by mog. DO NOT EDIT.
|
|
|
|
package pbcommongogo
|
|
|
|
import "github.com/hashicorp/consul/agent/structs"
|
|
|
|
func QueryMetaToStructs(s *QueryMeta, t *structs.QueryMeta) {
|
|
if s == nil {
|
|
return
|
|
}
|
|
t.Index = s.Index
|
|
t.LastContact = structs.DurationFromProtoGogo(s.LastContact)
|
|
t.KnownLeader = s.KnownLeader
|
|
t.ConsistencyLevel = s.ConsistencyLevel
|
|
t.ResultsFilteredByACLs = s.ResultsFilteredByACLs
|
|
}
|
|
func QueryMetaFromStructs(t *structs.QueryMeta, s *QueryMeta) {
|
|
if s == nil {
|
|
return
|
|
}
|
|
s.Index = t.Index
|
|
s.LastContact = structs.DurationToProtoGogo(t.LastContact)
|
|
s.KnownLeader = t.KnownLeader
|
|
s.ConsistencyLevel = t.ConsistencyLevel
|
|
s.ResultsFilteredByACLs = t.ResultsFilteredByACLs
|
|
}
|
|
func QueryOptionsToStructs(s *QueryOptions, t *structs.QueryOptions) {
|
|
if s == nil {
|
|
return
|
|
}
|
|
t.Token = s.Token
|
|
t.MinQueryIndex = s.MinQueryIndex
|
|
t.MaxQueryTime = structs.DurationFromProtoGogo(s.MaxQueryTime)
|
|
t.AllowStale = s.AllowStale
|
|
t.RequireConsistent = s.RequireConsistent
|
|
t.UseCache = s.UseCache
|
|
t.MaxStaleDuration = structs.DurationFromProtoGogo(s.MaxStaleDuration)
|
|
t.MaxAge = structs.DurationFromProtoGogo(s.MaxAge)
|
|
t.MustRevalidate = s.MustRevalidate
|
|
t.Filter = s.Filter
|
|
}
|
|
func QueryOptionsFromStructs(t *structs.QueryOptions, s *QueryOptions) {
|
|
if s == nil {
|
|
return
|
|
}
|
|
s.Token = t.Token
|
|
s.MinQueryIndex = t.MinQueryIndex
|
|
s.MaxQueryTime = structs.DurationToProtoGogo(t.MaxQueryTime)
|
|
s.AllowStale = t.AllowStale
|
|
s.RequireConsistent = t.RequireConsistent
|
|
s.UseCache = t.UseCache
|
|
s.MaxStaleDuration = structs.DurationToProtoGogo(t.MaxStaleDuration)
|
|
s.MaxAge = structs.DurationToProtoGogo(t.MaxAge)
|
|
s.MustRevalidate = t.MustRevalidate
|
|
s.Filter = t.Filter
|
|
}
|
|
func RaftIndexToStructs(s *RaftIndex, t *structs.RaftIndex) {
|
|
if s == nil {
|
|
return
|
|
}
|
|
t.CreateIndex = s.CreateIndex
|
|
t.ModifyIndex = s.ModifyIndex
|
|
}
|
|
func RaftIndexFromStructs(t *structs.RaftIndex, s *RaftIndex) {
|
|
if s == nil {
|
|
return
|
|
}
|
|
s.CreateIndex = t.CreateIndex
|
|
s.ModifyIndex = t.ModifyIndex
|
|
}
|