Documentation ¶
Index ¶
- Variables
- func EnterpriseMetaFromStructs(t *acl.EnterpriseMeta, s *EnterpriseMeta)
- func EnterpriseMetaToStructs(s *EnterpriseMeta, t *acl.EnterpriseMeta)
- func EnvoyExtensionFromStructs(t *structs.EnvoyExtension, s *EnvoyExtension)
- func EnvoyExtensionToStructs(s *EnvoyExtension, t *structs.EnvoyExtension)
- func EnvoyExtensionsToStructs(args []*EnvoyExtension) []structs.EnvoyExtension
- func MapStringInterfaceToProtobufTypesStruct(m map[string]interface{}) *structpb.Struct
- func ProtobufTypesStructToMapStringInterface(s *structpb.Struct) map[string]interface{}
- func QueryMetaFromStructs(t *structs.QueryMeta, s *QueryMeta)
- func QueryMetaToStructs(s *QueryMeta, t *structs.QueryMeta)
- func QueryOptionsFromStructs(t *structs.QueryOptions, s *QueryOptions)
- func QueryOptionsToStructs(s *QueryOptions, t *structs.QueryOptions)
- func RaftIndexFromStructs(t *structs.RaftIndex, s *RaftIndex)
- func RaftIndexToStructs(s *RaftIndex, t *structs.RaftIndex)
- func SliceToPBListValue(s []interface{}) *structpb.ListValue
- func WriteRequestFromStructs(t *structs.WriteRequest, s *WriteRequest)
- func WriteRequestToStructs(s *WriteRequest, t *structs.WriteRequest)
- type EnterpriseMeta
- func (*EnterpriseMeta) Descriptor() ([]byte, []int)deprecated
- func (x *EnterpriseMeta) GetNamespace() string
- func (x *EnterpriseMeta) GetPartition() string
- func (msg *EnterpriseMeta) MarshalBinary() ([]byte, error)
- func (*EnterpriseMeta) ProtoMessage()
- func (x *EnterpriseMeta) ProtoReflect() protoreflect.Message
- func (x *EnterpriseMeta) Reset()
- func (x *EnterpriseMeta) String() string
- func (msg *EnterpriseMeta) UnmarshalBinary(b []byte) error
- type EnvoyExtension
- func (*EnvoyExtension) Descriptor() ([]byte, []int)deprecated
- func (x *EnvoyExtension) GetArguments() *structpb.Struct
- func (x *EnvoyExtension) GetName() string
- func (x *EnvoyExtension) GetRequired() bool
- func (msg *EnvoyExtension) MarshalBinary() ([]byte, error)
- func (*EnvoyExtension) ProtoMessage()
- func (x *EnvoyExtension) ProtoReflect() protoreflect.Message
- func (x *EnvoyExtension) Reset()
- func (x *EnvoyExtension) String() string
- func (msg *EnvoyExtension) UnmarshalBinary(b []byte) error
- type QueryMeta
- func (*QueryMeta) Descriptor() ([]byte, []int)deprecated
- func (q *QueryMeta) GetBackend() structs.QueryBackend
- func (x *QueryMeta) GetConsistencyLevel() string
- func (x *QueryMeta) GetIndex() uint64
- func (x *QueryMeta) GetKnownLeader() bool
- func (x *QueryMeta) GetLastContact() *durationpb.Duration
- func (x *QueryMeta) GetResultsFilteredByACLs() bool
- func (msg *QueryMeta) MarshalBinary() ([]byte, error)
- func (*QueryMeta) ProtoMessage()
- func (x *QueryMeta) ProtoReflect() protoreflect.Message
- func (x *QueryMeta) Reset()
- func (q *QueryMeta) SetConsistencyLevel(consistencyLevel string)
- func (q *QueryMeta) SetIndex(index uint64)
- func (q *QueryMeta) SetKnownLeader(knownLeader bool)
- func (q *QueryMeta) SetLastContact(lastContact time.Duration)
- func (q *QueryMeta) SetResultsFilteredByACLs(v bool)
- func (x *QueryMeta) String() string
- func (msg *QueryMeta) UnmarshalBinary(b []byte) error
- type QueryOptions
- func (q *QueryOptions) AllowStaleRead() bool
- func (q *QueryOptions) BlockingTimeout(maxQueryTime, defaultQueryTime time.Duration) time.Duration
- func (*QueryOptions) Descriptor() ([]byte, []int)deprecated
- func (x *QueryOptions) GetAllowStale() bool
- func (x *QueryOptions) GetFilter() string
- func (x *QueryOptions) GetMaxAge() *durationpb.Duration
- func (x *QueryOptions) GetMaxQueryTime() *durationpb.Duration
- func (x *QueryOptions) GetMaxStaleDuration() *durationpb.Duration
- func (x *QueryOptions) GetMinQueryIndex() uint64
- func (x *QueryOptions) GetMustRevalidate() bool
- func (x *QueryOptions) GetRequireConsistent() bool
- func (x *QueryOptions) GetStaleIfError() *durationpb.Duration
- func (x *QueryOptions) GetToken() string
- func (x *QueryOptions) GetUseCache() bool
- func (q *QueryOptions) HasTimedOut(start time.Time, rpcHoldTimeout, maxQueryTime, defaultQueryTime time.Duration) (bool, error)
- func (q *QueryOptions) IsRead() bool
- func (msg *QueryOptions) MarshalBinary() ([]byte, error)
- func (*QueryOptions) ProtoMessage()
- func (x *QueryOptions) ProtoReflect() protoreflect.Message
- func (x *QueryOptions) Reset()
- func (q *QueryOptions) SetAllowStale(allowStale bool)
- func (q *QueryOptions) SetFilter(filter string)
- func (q *QueryOptions) SetMaxAge(maxAge time.Duration)
- func (q *QueryOptions) SetMaxQueryTime(maxQueryTime time.Duration)
- func (q *QueryOptions) SetMaxStaleDuration(maxStaleDuration time.Duration)
- func (q *QueryOptions) SetMinQueryIndex(minQueryIndex uint64)
- func (q *QueryOptions) SetMustRevalidate(mustRevalidate bool)
- func (q *QueryOptions) SetRequireConsistent(requireConsistent bool)
- func (q *QueryOptions) SetStaleIfError(staleIfError time.Duration)
- func (q *QueryOptions) SetToken(token string)
- func (q *QueryOptions) SetTokenSecret(s string)
- func (q *QueryOptions) SetUseCache(useCache bool)
- func (x *QueryOptions) String() string
- func (q *QueryOptions) TokenSecret() string
- func (msg *QueryOptions) UnmarshalBinary(b []byte) error
- type RaftIndex
- func (*RaftIndex) Descriptor() ([]byte, []int)deprecated
- func (x *RaftIndex) GetCreateIndex() uint64
- func (x *RaftIndex) GetModifyIndex() uint64
- func (msg *RaftIndex) MarshalBinary() ([]byte, error)
- func (*RaftIndex) ProtoMessage()
- func (x *RaftIndex) ProtoReflect() protoreflect.Message
- func (x *RaftIndex) Reset()
- func (x *RaftIndex) String() string
- func (msg *RaftIndex) UnmarshalBinary(b []byte) error
- type ReadRequest
- func (r *ReadRequest) AllowStaleRead() bool
- func (*ReadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReadRequest) GetRequireConsistent() bool
- func (x *ReadRequest) GetToken() string
- func (r *ReadRequest) HasTimedOut(start time.Time, rpcHoldTimeout, _, _ time.Duration) (bool, error)
- func (r *ReadRequest) IsRead() bool
- func (msg *ReadRequest) MarshalBinary() ([]byte, error)
- func (*ReadRequest) ProtoMessage()
- func (x *ReadRequest) ProtoReflect() protoreflect.Message
- func (x *ReadRequest) Reset()
- func (r *ReadRequest) SetTokenSecret(token string)
- func (x *ReadRequest) String() string
- func (r *ReadRequest) TokenSecret() string
- func (msg *ReadRequest) UnmarshalBinary(b []byte) error
- type TargetDatacenter
- func (*TargetDatacenter) Descriptor() ([]byte, []int)deprecated
- func (x *TargetDatacenter) GetDatacenter() string
- func (msg *TargetDatacenter) MarshalBinary() ([]byte, error)
- func (*TargetDatacenter) ProtoMessage()
- func (x *TargetDatacenter) ProtoReflect() protoreflect.Message
- func (td *TargetDatacenter) RequestDatacenter() string
- func (x *TargetDatacenter) Reset()
- func (x *TargetDatacenter) String() string
- func (msg *TargetDatacenter) UnmarshalBinary(b []byte) error
- type WriteRequest
- func (w *WriteRequest) AllowStaleRead() bool
- func (*WriteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WriteRequest) GetToken() string
- func (w *WriteRequest) HasTimedOut(start time.Time, rpcHoldTimeout, maxQueryTime, defaultQueryTime time.Duration) (bool, error)
- func (w *WriteRequest) IsRead() bool
- func (msg *WriteRequest) MarshalBinary() ([]byte, error)
- func (*WriteRequest) ProtoMessage()
- func (x *WriteRequest) ProtoReflect() protoreflect.Message
- func (x *WriteRequest) Reset()
- func (w *WriteRequest) SetTokenSecret(s string)
- func (x *WriteRequest) String() string
- func (w *WriteRequest) TokenSecret() string
- func (msg *WriteRequest) UnmarshalBinary(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var DefaultEnterpriseMeta = &EnterpriseMeta{}
var File_proto_pbcommon_common_proto protoreflect.FileDescriptor
Functions ¶
func EnterpriseMetaFromStructs ¶ added in v1.12.0
func EnterpriseMetaFromStructs(t *acl.EnterpriseMeta, s *EnterpriseMeta)
func EnterpriseMetaToStructs ¶ added in v1.12.0
func EnterpriseMetaToStructs(s *EnterpriseMeta, t *acl.EnterpriseMeta)
func EnvoyExtensionFromStructs ¶ added in v1.15.0
func EnvoyExtensionFromStructs(t *structs.EnvoyExtension, s *EnvoyExtension)
func EnvoyExtensionToStructs ¶ added in v1.15.0
func EnvoyExtensionToStructs(s *EnvoyExtension, t *structs.EnvoyExtension)
func EnvoyExtensionsToStructs ¶ added in v1.15.0
func EnvoyExtensionsToStructs(args []*EnvoyExtension) []structs.EnvoyExtension
EnvoyExtensionsToStructs takes a protobuf EnvoyExtension argument and converts it to the structs EnvoyExtension
func MapStringInterfaceToProtobufTypesStruct ¶ added in v1.15.0
MapStringInterfaceToProtobufTypesStruct converts a map[string]interface{} into a proto.Struct
func ProtobufTypesStructToMapStringInterface ¶ added in v1.15.0
ProtobufTypesStructToMapStringInterface converts a protobuf/structpb.Struct into a map[string]interface{}.
func QueryMetaFromStructs ¶ added in v1.12.0
func QueryMetaToStructs ¶ added in v1.12.0
func QueryOptionsFromStructs ¶ added in v1.12.0
func QueryOptionsFromStructs(t *structs.QueryOptions, s *QueryOptions)
func QueryOptionsToStructs ¶ added in v1.12.0
func QueryOptionsToStructs(s *QueryOptions, t *structs.QueryOptions)
func RaftIndexFromStructs ¶ added in v1.12.0
func RaftIndexToStructs ¶ added in v1.12.0
func SliceToPBListValue ¶ added in v1.15.0
SliceToPBListValue converts a []interface{} into a proto.ListValue. It's used internally by MapStringInterfaceToProtobufTypesStruct when it encouters slices. TODO (remove usage of this struct in favor of structpb.NewListValue)
func WriteRequestFromStructs ¶ added in v1.12.0
func WriteRequestFromStructs(t *structs.WriteRequest, s *WriteRequest)
func WriteRequestToStructs ¶ added in v1.12.0
func WriteRequestToStructs(s *WriteRequest, t *structs.WriteRequest)
Types ¶
type EnterpriseMeta ¶
type EnterpriseMeta struct { // Namespace in which the entity exists. Namespace string `protobuf:"bytes,1,opt,name=Namespace,proto3" json:"Namespace,omitempty"` // Partition in which the entity exists. Partition string `protobuf:"bytes,2,opt,name=Partition,proto3" json:"Partition,omitempty"` // contains filtered or unexported fields }
EnterpriseMeta contains metadata that is only used by the Enterprise version of Consul.
func NewEnterpriseMetaFromStructs ¶ added in v1.12.0
func NewEnterpriseMetaFromStructs(_ acl.EnterpriseMeta) *EnterpriseMeta
func (*EnterpriseMeta) Descriptor
deprecated
func (*EnterpriseMeta) Descriptor() ([]byte, []int)
Deprecated: Use EnterpriseMeta.ProtoReflect.Descriptor instead.
func (*EnterpriseMeta) GetNamespace ¶ added in v1.12.0
func (x *EnterpriseMeta) GetNamespace() string
func (*EnterpriseMeta) GetPartition ¶ added in v1.12.0
func (x *EnterpriseMeta) GetPartition() string
func (*EnterpriseMeta) MarshalBinary ¶
func (msg *EnterpriseMeta) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*EnterpriseMeta) ProtoMessage ¶
func (*EnterpriseMeta) ProtoMessage()
func (*EnterpriseMeta) ProtoReflect ¶ added in v1.12.0
func (x *EnterpriseMeta) ProtoReflect() protoreflect.Message
func (*EnterpriseMeta) Reset ¶
func (x *EnterpriseMeta) Reset()
func (*EnterpriseMeta) String ¶
func (x *EnterpriseMeta) String() string
func (*EnterpriseMeta) UnmarshalBinary ¶
func (msg *EnterpriseMeta) UnmarshalBinary(b []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler
type EnvoyExtension ¶ added in v1.15.0
type EnvoyExtension struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` Required bool `protobuf:"varint,2,opt,name=Required,proto3" json:"Required,omitempty"` // mog: func-to=ProtobufTypesStructToMapStringInterface func-from=MapStringInterfaceToProtobufTypesStruct Arguments *structpb.Struct `protobuf:"bytes,3,opt,name=Arguments,proto3" json:"Arguments,omitempty"` // contains filtered or unexported fields }
mog annotation:
target=github.com/hashicorp/consul/agent/structs.EnvoyExtension output=common.gen.go name=Structs
func EnvoyExtensionsFromStructs ¶ added in v1.15.0
func EnvoyExtensionsFromStructs(args []structs.EnvoyExtension) []*EnvoyExtension
EnvoyExtensionsFromStructs takes a structs EnvoyExtension argument and converts it to the protobuf EnvoyExtension
func (*EnvoyExtension) Descriptor
deprecated
added in
v1.15.0
func (*EnvoyExtension) Descriptor() ([]byte, []int)
Deprecated: Use EnvoyExtension.ProtoReflect.Descriptor instead.
func (*EnvoyExtension) GetArguments ¶ added in v1.15.0
func (x *EnvoyExtension) GetArguments() *structpb.Struct
func (*EnvoyExtension) GetName ¶ added in v1.15.0
func (x *EnvoyExtension) GetName() string
func (*EnvoyExtension) GetRequired ¶ added in v1.15.0
func (x *EnvoyExtension) GetRequired() bool
func (*EnvoyExtension) MarshalBinary ¶ added in v1.15.0
func (msg *EnvoyExtension) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*EnvoyExtension) ProtoMessage ¶ added in v1.15.0
func (*EnvoyExtension) ProtoMessage()
func (*EnvoyExtension) ProtoReflect ¶ added in v1.15.0
func (x *EnvoyExtension) ProtoReflect() protoreflect.Message
func (*EnvoyExtension) Reset ¶ added in v1.15.0
func (x *EnvoyExtension) Reset()
func (*EnvoyExtension) String ¶ added in v1.15.0
func (x *EnvoyExtension) String() string
func (*EnvoyExtension) UnmarshalBinary ¶ added in v1.15.0
func (msg *EnvoyExtension) UnmarshalBinary(b []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler
type QueryMeta ¶
type QueryMeta struct { // This is the index associated with the read Index uint64 `protobuf:"varint,1,opt,name=Index,proto3" json:"Index,omitempty"` // If AllowStale is used, this is time elapsed since // last contact between the follower and leader. This // can be used to gauge staleness. // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto LastContact *durationpb.Duration `protobuf:"bytes,2,opt,name=LastContact,proto3" json:"LastContact,omitempty"` // Used to indicate if there is a known leader node KnownLeader bool `protobuf:"varint,3,opt,name=KnownLeader,proto3" json:"KnownLeader,omitempty"` // Consistencylevel returns the consistency used to serve the query // Having `discovery_max_stale` on the agent can affect whether // the request was served by a leader. ConsistencyLevel string `protobuf:"bytes,4,opt,name=ConsistencyLevel,proto3" json:"ConsistencyLevel,omitempty"` // ResultsFilteredByACLs is true when some of the query's results were // filtered out by enforcing ACLs. It may be false because nothing was // removed, or because the endpoint does not yet support this flag. ResultsFilteredByACLs bool `protobuf:"varint,7,opt,name=ResultsFilteredByACLs,proto3" json:"ResultsFilteredByACLs,omitempty"` // contains filtered or unexported fields }
QueryMeta allows a query response to include potentially useful metadata about a query
mog annotation:
target=github.com/hashicorp/consul/agent/structs.QueryMeta output=common.gen.go name=Structs ignore-fields=NotModified,Backend,state,sizeCache,unknownFields
func (*QueryMeta) Descriptor
deprecated
func (*QueryMeta) GetBackend ¶ added in v1.10.1
func (q *QueryMeta) GetBackend() structs.QueryBackend
func (*QueryMeta) GetConsistencyLevel ¶
func (*QueryMeta) GetKnownLeader ¶
func (*QueryMeta) GetLastContact ¶
func (x *QueryMeta) GetLastContact() *durationpb.Duration
func (*QueryMeta) GetResultsFilteredByACLs ¶ added in v1.11.0
func (*QueryMeta) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler
func (*QueryMeta) ProtoMessage ¶
func (*QueryMeta) ProtoMessage()
func (*QueryMeta) ProtoReflect ¶ added in v1.12.0
func (x *QueryMeta) ProtoReflect() protoreflect.Message
func (*QueryMeta) SetConsistencyLevel ¶
SetConsistencyLevel is needed to implement the structs.QueryMetaCompat interface
func (*QueryMeta) SetKnownLeader ¶
SetKnownLeader is needed to implement the structs.QueryMetaCompat interface
func (*QueryMeta) SetLastContact ¶
SetLastContact is needed to implement the structs.QueryMetaCompat interface
func (*QueryMeta) SetResultsFilteredByACLs ¶ added in v1.12.0
SetResultsFilteredByACLs is needed to implement the structs.QueryMetaCompat interface
func (*QueryMeta) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler
type QueryOptions ¶
type QueryOptions struct { // Token is the ACL token ID. If not provided, the 'anonymous' // token is assumed for backwards compatibility. Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` // If set, wait until query exceeds given index. Must be provided // with MaxQueryTime. MinQueryIndex uint64 `protobuf:"varint,2,opt,name=MinQueryIndex,proto3" json:"MinQueryIndex,omitempty"` // Provided with MinQueryIndex to wait for change. // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto MaxQueryTime *durationpb.Duration `protobuf:"bytes,3,opt,name=MaxQueryTime,proto3" json:"MaxQueryTime,omitempty"` // If set, any follower can service the request. Results // may be arbitrarily stale. AllowStale bool `protobuf:"varint,4,opt,name=AllowStale,proto3" json:"AllowStale,omitempty"` // If set, the leader must verify leadership prior to // servicing the request. Prevents a stale read. RequireConsistent bool `protobuf:"varint,5,opt,name=RequireConsistent,proto3" json:"RequireConsistent,omitempty"` // If set, the local agent may respond with an arbitrarily stale locally // cached response. The semantics differ from AllowStale since the agent may // be entirely partitioned from the servers and still considered "healthy" by // operators. Stale responses from Servers are also arbitrarily stale, but can // provide additional bounds on the last contact time from the leader. It's // expected that servers that are partitioned are noticed and replaced in a // timely way by operators while the same may not be true for client agents. UseCache bool `protobuf:"varint,6,opt,name=UseCache,proto3" json:"UseCache,omitempty"` // If set and AllowStale is true, will try first a stale // read, and then will perform a consistent read if stale // read is older than value. // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto MaxStaleDuration *durationpb.Duration `protobuf:"bytes,7,opt,name=MaxStaleDuration,proto3" json:"MaxStaleDuration,omitempty"` // MaxAge limits how old a cached value will be returned if UseCache is true. // If there is a cached response that is older than the MaxAge, it is treated // as a cache miss and a new fetch invoked. If the fetch fails, the error is // returned. Clients that wish to allow for stale results on error can set // StaleIfError to a longer duration to change this behavior. It is ignored // if the endpoint supports background refresh caching. See // https://www.consul.io/api/index.html#agent-caching for more details. // mog: func-to=structs.DurationFromProto func-from=structs.DurationToProto MaxAge *durationpb.Duration `protobuf:"bytes,8,opt,name=MaxAge,proto3" json:"MaxAge,omitempty"` // MustRevalidate forces the agent to fetch a fresh version of a cached // resource or at least validate that the cached version is still fresh. It is // implied by either max-age=0 or must-revalidate Cache-Control headers. It // only makes sense when UseCache is true. We store it since MaxAge = 0 is the // default unset value. MustRevalidate bool `protobuf:"varint,9,opt,name=MustRevalidate,proto3" json:"MustRevalidate,omitempty"` // StaleIfError specifies how stale the client will accept a cached response // if the servers are unavailable to fetch a fresh one. Only makes sense when // UseCache is true and MaxAge is set to a lower, non-zero value. It is // ignored if the endpoint supports background refresh caching. See // https://www.consul.io/api/index.html#agent-caching for more details. StaleIfError *durationpb.Duration `protobuf:"bytes,10,opt,name=StaleIfError,proto3" json:"StaleIfError,omitempty"` // Filter specifies the go-bexpr filter expression to be used for // filtering the data prior to returning a response Filter string `protobuf:"bytes,11,opt,name=Filter,proto3" json:"Filter,omitempty"` // contains filtered or unexported fields }
QueryOptions is used to specify various flags for read queries
mog annotation:
target=github.com/hashicorp/consul/agent/structs.QueryOptions output=common.gen.go name=Structs ignore-fields=StaleIfError,AllowNotModifiedResponse,state,sizeCache,unknownFields
func (*QueryOptions) AllowStaleRead ¶
func (q *QueryOptions) AllowStaleRead() bool
AllowStaleRead returns whether a stale read should be allowed
func (*QueryOptions) BlockingTimeout ¶ added in v1.11.11
func (q *QueryOptions) BlockingTimeout(maxQueryTime, defaultQueryTime time.Duration) time.Duration
BlockingTimeout implements pool.BlockableQuery
func (*QueryOptions) Descriptor
deprecated
func (*QueryOptions) Descriptor() ([]byte, []int)
Deprecated: Use QueryOptions.ProtoReflect.Descriptor instead.
func (*QueryOptions) GetAllowStale ¶
func (x *QueryOptions) GetAllowStale() bool
func (*QueryOptions) GetFilter ¶
func (x *QueryOptions) GetFilter() string
func (*QueryOptions) GetMaxAge ¶
func (x *QueryOptions) GetMaxAge() *durationpb.Duration
func (*QueryOptions) GetMaxQueryTime ¶
func (x *QueryOptions) GetMaxQueryTime() *durationpb.Duration
func (*QueryOptions) GetMaxStaleDuration ¶
func (x *QueryOptions) GetMaxStaleDuration() *durationpb.Duration
func (*QueryOptions) GetMinQueryIndex ¶
func (x *QueryOptions) GetMinQueryIndex() uint64
func (*QueryOptions) GetMustRevalidate ¶
func (x *QueryOptions) GetMustRevalidate() bool
func (*QueryOptions) GetRequireConsistent ¶
func (x *QueryOptions) GetRequireConsistent() bool
func (*QueryOptions) GetStaleIfError ¶
func (x *QueryOptions) GetStaleIfError() *durationpb.Duration
func (*QueryOptions) GetToken ¶
func (x *QueryOptions) GetToken() string
func (*QueryOptions) GetUseCache ¶
func (x *QueryOptions) GetUseCache() bool
func (*QueryOptions) HasTimedOut ¶ added in v1.11.0
func (*QueryOptions) IsRead ¶
func (q *QueryOptions) IsRead() bool
IsRead is always true for QueryOption
func (*QueryOptions) MarshalBinary ¶
func (msg *QueryOptions) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*QueryOptions) ProtoMessage ¶
func (*QueryOptions) ProtoMessage()
func (*QueryOptions) ProtoReflect ¶ added in v1.12.0
func (x *QueryOptions) ProtoReflect() protoreflect.Message
func (*QueryOptions) Reset ¶
func (x *QueryOptions) Reset()
func (*QueryOptions) SetAllowStale ¶
func (q *QueryOptions) SetAllowStale(allowStale bool)
SetAllowStale is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetFilter ¶
func (q *QueryOptions) SetFilter(filter string)
SetFilter is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetMaxAge ¶
func (q *QueryOptions) SetMaxAge(maxAge time.Duration)
SetMaxAge is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetMaxQueryTime ¶
func (q *QueryOptions) SetMaxQueryTime(maxQueryTime time.Duration)
SetMaxQueryTime is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetMaxStaleDuration ¶
func (q *QueryOptions) SetMaxStaleDuration(maxStaleDuration time.Duration)
SetMaxStaleDuration is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetMinQueryIndex ¶
func (q *QueryOptions) SetMinQueryIndex(minQueryIndex uint64)
SetMinQueryIndex is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetMustRevalidate ¶
func (q *QueryOptions) SetMustRevalidate(mustRevalidate bool)
SetMustRevalidate is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetRequireConsistent ¶
func (q *QueryOptions) SetRequireConsistent(requireConsistent bool)
SetRequireConsistent is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetStaleIfError ¶
func (q *QueryOptions) SetStaleIfError(staleIfError time.Duration)
SetStaleIfError is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetToken ¶
func (q *QueryOptions) SetToken(token string)
SetToken is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) SetTokenSecret ¶
func (q *QueryOptions) SetTokenSecret(s string)
func (*QueryOptions) SetUseCache ¶
func (q *QueryOptions) SetUseCache(useCache bool)
SetUseCache is needed to implement the structs.QueryOptionsCompat interface
func (*QueryOptions) String ¶
func (x *QueryOptions) String() string
func (*QueryOptions) TokenSecret ¶
func (q *QueryOptions) TokenSecret() string
func (*QueryOptions) UnmarshalBinary ¶
func (msg *QueryOptions) UnmarshalBinary(b []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler
type RaftIndex ¶
type RaftIndex struct { // @gotags: bexpr:"-" CreateIndex uint64 `protobuf:"varint,1,opt,name=CreateIndex,proto3" json:"CreateIndex,omitempty" bexpr:"-"` // @gotags: bexpr:"-" ModifyIndex uint64 `protobuf:"varint,2,opt,name=ModifyIndex,proto3" json:"ModifyIndex,omitempty" bexpr:"-"` // contains filtered or unexported fields }
RaftIndex is used to track the index used while creating or modifying a given struct type.
mog annotation:
target=github.com/hashicorp/consul/agent/structs.RaftIndex output=common.gen.go name=Structs ignore-fields=state,sizeCache,unknownFields
func (*RaftIndex) Descriptor
deprecated
func (*RaftIndex) GetCreateIndex ¶ added in v1.12.0
func (*RaftIndex) GetModifyIndex ¶ added in v1.12.0
func (*RaftIndex) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler
func (*RaftIndex) ProtoMessage ¶
func (*RaftIndex) ProtoMessage()
func (*RaftIndex) ProtoReflect ¶ added in v1.12.0
func (x *RaftIndex) ProtoReflect() protoreflect.Message
func (*RaftIndex) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler
type ReadRequest ¶ added in v1.11.0
type ReadRequest struct { // Token is the ACL token ID. If not provided, the 'anonymous' // token is assumed for backwards compatibility. Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` // RequireConsistent indicates that the request must be sent to the leader. RequireConsistent bool `protobuf:"varint,2,opt,name=RequireConsistent,proto3" json:"RequireConsistent,omitempty"` // contains filtered or unexported fields }
ReadRequest is a type that may be embedded into any requests for read operations. It is a replacement for QueryOptions now that we no longer need any of those fields because we are moving away from using blocking queries. It is also similar to WriteRequest. It is a separate type so that in the future we can introduce fields that may only be relevant for reads.
func (*ReadRequest) AllowStaleRead ¶ added in v1.11.0
func (r *ReadRequest) AllowStaleRead() bool
AllowStaleRead implements structs.RPCInfo
func (*ReadRequest) Descriptor
deprecated
added in
v1.11.0
func (*ReadRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
func (*ReadRequest) GetRequireConsistent ¶ added in v1.11.0
func (x *ReadRequest) GetRequireConsistent() bool
func (*ReadRequest) GetToken ¶ added in v1.11.0
func (x *ReadRequest) GetToken() string
func (*ReadRequest) HasTimedOut ¶ added in v1.11.0
func (r *ReadRequest) HasTimedOut(start time.Time, rpcHoldTimeout, _, _ time.Duration) (bool, error)
HasTimedOut implements structs.RPCInfo
func (*ReadRequest) IsRead ¶ added in v1.11.0
func (r *ReadRequest) IsRead() bool
IsRead implements structs.RPCInfo
func (*ReadRequest) MarshalBinary ¶ added in v1.11.0
func (msg *ReadRequest) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*ReadRequest) ProtoMessage ¶ added in v1.11.0
func (*ReadRequest) ProtoMessage()
func (*ReadRequest) ProtoReflect ¶ added in v1.12.0
func (x *ReadRequest) ProtoReflect() protoreflect.Message
func (*ReadRequest) Reset ¶ added in v1.11.0
func (x *ReadRequest) Reset()
func (*ReadRequest) SetTokenSecret ¶ added in v1.11.0
func (r *ReadRequest) SetTokenSecret(token string)
SetTokenSecret implements structs.RPCInfo
func (*ReadRequest) String ¶ added in v1.11.0
func (x *ReadRequest) String() string
func (*ReadRequest) TokenSecret ¶ added in v1.11.0
func (r *ReadRequest) TokenSecret() string
TokenSecret implements structs.RPCInfo
func (*ReadRequest) UnmarshalBinary ¶ added in v1.11.0
func (msg *ReadRequest) UnmarshalBinary(b []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler
type TargetDatacenter ¶
type TargetDatacenter struct { Datacenter string `protobuf:"bytes,1,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` // contains filtered or unexported fields }
TargetDatacenter is intended to be used within other messages used for RPC routing amongst the various Consul datacenters
func (*TargetDatacenter) Descriptor
deprecated
func (*TargetDatacenter) Descriptor() ([]byte, []int)
Deprecated: Use TargetDatacenter.ProtoReflect.Descriptor instead.
func (*TargetDatacenter) GetDatacenter ¶ added in v1.12.0
func (x *TargetDatacenter) GetDatacenter() string
func (*TargetDatacenter) MarshalBinary ¶
func (msg *TargetDatacenter) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*TargetDatacenter) ProtoMessage ¶
func (*TargetDatacenter) ProtoMessage()
func (*TargetDatacenter) ProtoReflect ¶ added in v1.12.0
func (x *TargetDatacenter) ProtoReflect() protoreflect.Message
func (*TargetDatacenter) RequestDatacenter ¶
func (td *TargetDatacenter) RequestDatacenter() string
RequestDatacenter implements structs.RPCInfo
func (*TargetDatacenter) Reset ¶
func (x *TargetDatacenter) Reset()
func (*TargetDatacenter) String ¶
func (x *TargetDatacenter) String() string
func (*TargetDatacenter) UnmarshalBinary ¶
func (msg *TargetDatacenter) UnmarshalBinary(b []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler
type WriteRequest ¶
type WriteRequest struct { // Token is the ACL token ID. If not provided, the 'anonymous' // token is assumed for backwards compatibility. Token string `protobuf:"bytes,1,opt,name=Token,proto3" json:"Token,omitempty"` // contains filtered or unexported fields }
mog annotation:
target=github.com/hashicorp/consul/agent/structs.WriteRequest output=common.gen.go name=Structs ignore-fields=state,sizeCache,unknownFields
func (*WriteRequest) AllowStaleRead ¶
func (w *WriteRequest) AllowStaleRead() bool
AllowStaleRead returns whether a stale read should be allowed
AllowStaleRead implements structs.RPCInfo
func (*WriteRequest) Descriptor
deprecated
func (*WriteRequest) Descriptor() ([]byte, []int)
Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.
func (*WriteRequest) GetToken ¶
func (x *WriteRequest) GetToken() string
func (*WriteRequest) HasTimedOut ¶ added in v1.11.0
func (w *WriteRequest) HasTimedOut(start time.Time, rpcHoldTimeout, maxQueryTime, defaultQueryTime time.Duration) (bool, error)
HasTimedOut implements structs.RPCInfo
func (*WriteRequest) IsRead ¶
func (w *WriteRequest) IsRead() bool
WriteRequest only applies to writes, always false
IsRead implements structs.RPCInfo
func (*WriteRequest) MarshalBinary ¶
func (msg *WriteRequest) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler
func (*WriteRequest) ProtoMessage ¶
func (*WriteRequest) ProtoMessage()
func (*WriteRequest) ProtoReflect ¶ added in v1.12.0
func (x *WriteRequest) ProtoReflect() protoreflect.Message
func (*WriteRequest) Reset ¶
func (x *WriteRequest) Reset()
func (*WriteRequest) SetTokenSecret ¶
func (w *WriteRequest) SetTokenSecret(s string)
SetTokenSecret implements structs.RPCInfo
func (*WriteRequest) String ¶
func (x *WriteRequest) String() string
func (*WriteRequest) TokenSecret ¶
func (w *WriteRequest) TokenSecret() string
SetTokenSecret implements structs.RPCInfo
func (*WriteRequest) UnmarshalBinary ¶
func (msg *WriteRequest) UnmarshalBinary(b []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler