consul

package
v1.16.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConsulConsistencyModes_name = map[int32]string{
		0: "DefaultMode",
		1: "StaleMode",
		2: "ConsistentMode",
	}
	ConsulConsistencyModes_value = map[string]int32{
		"DefaultMode":    0,
		"StaleMode":      1,
		"ConsistentMode": 2,
	}
)

Enum value maps for ConsulConsistencyModes.

View Source
var File_github_com_solo_io_gloo_projects_gloo_api_v1_options_consul_consul_proto protoreflect.FileDescriptor
View Source
var File_github_com_solo_io_gloo_projects_gloo_api_v1_options_consul_query_options_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ConsulConsistencyModes added in v1.9.25

type ConsulConsistencyModes int32

These are the same consistency modes offered by Consul. For more information please review https://www.consul.io/api-docs/features/consistency. and https://pkg.go.dev/github.com/hashicorp/consul/api#QueryOptions.

Note: Gloo handles staleness well (as it runs update loops ~ once/second) but makes many requests to get consul endpoints so users may want to opt into stale reads once the implications are understood.

const (
	// default - Consul HTTP API queries use default mode by default.
	// It is strongly consistent in almost all cases. However, there is a small
	// window in which a new leader may be elected during which the old leader may
	// respond with stale values. The trade-off is fast reads but potentially stale
	// values. The condition resulting in stale reads is hard to trigger, and most
	// clients should not need to worry about this case. Also, note that this race
	// condition only applies to reads, not writes.
	//
	// For more, see https://www.consul.io/api-docs/features/consistency#consul-http-api-queries
	ConsulConsistencyModes_DefaultMode ConsulConsistencyModes = 0
	// AllowStale allows any Consul server (non-leader) to service
	// a read. This allows for lower latency and higher throughput
	//
	// stale - Consul DNS queries use stale mode by default. This mode allows any
	// server to handle the read regardless of whether it is the leader. The trade-off
	// is very fast and scalable reads with a higher likelihood of stale values. Results
	// are generally consistent to within 50 milliseconds of the leader, though there is
	// no upper limit on this staleness. Since this mode allows reads without a leader, a
	// cluster that is unavailable (no quorum) can still respond to queries.
	//
	// Gloo handles staleness well (as it runs update loops ~ once/second) so users may want
	// to opt into this.
	ConsulConsistencyModes_StaleMode ConsulConsistencyModes = 1
	// RequireConsistent forces the read to be fully consistent.
	// This is more expensive but prevents ever performing a stale
	// read.
	//
	// consistent - This mode is strongly consistent without caveats. It requires that a
	// leader verify with a quorum of peers that it is still leader. This introduces an
	// additional round-trip to all server nodes. The trade-off is increased latency due
	// to an extra round trip. Most clients should not use this unless they cannot tolerate
	// a stale read.
	//
	// Gloo handles staleness well (as it runs update loops ~ once/second) so users may want
	// to strongly consider their requirements before enabling this.
	ConsulConsistencyModes_ConsistentMode ConsulConsistencyModes = 2
)

func (ConsulConsistencyModes) Descriptor added in v1.9.25

func (ConsulConsistencyModes) Enum added in v1.9.25

func (ConsulConsistencyModes) EnumDescriptor deprecated added in v1.9.25

func (ConsulConsistencyModes) EnumDescriptor() ([]byte, []int)

Deprecated: Use ConsulConsistencyModes.Descriptor instead.

func (ConsulConsistencyModes) Number added in v1.9.25

func (ConsulConsistencyModes) String added in v1.9.25

func (x ConsulConsistencyModes) String() string

func (ConsulConsistencyModes) Type added in v1.9.25

type QueryOptions added in v1.9.25

type QueryOptions struct {

	// UseCache requests that the agent cache results locally. See
	// https://www.consul.io/api/features/caching.html for more details on the
	// semantics.
	//
	// Defaults to true.
	// opts users into background refresh caching https://www.consul.io/api-docs/features/caching#background-refresh-caching
	UseCache *wrappers.BoolValue `protobuf:"bytes,1,opt,name=use_cache,json=useCache,proto3" json:"use_cache,omitempty"`
	// contains filtered or unexported fields
}

somewhat mirrors client query options struct in consul catalog api only has options that we know we want configurable at both upstream and settings-wide discovery levels

func (*QueryOptions) Clone added in v1.9.25

func (m *QueryOptions) Clone() proto.Message

Clone function

func (*QueryOptions) Descriptor deprecated added in v1.9.25

func (*QueryOptions) Descriptor() ([]byte, []int)

Deprecated: Use QueryOptions.ProtoReflect.Descriptor instead.

func (*QueryOptions) Equal added in v1.9.25

func (m *QueryOptions) Equal(that interface{}) bool

Equal function

func (*QueryOptions) GetUseCache added in v1.9.25

func (x *QueryOptions) GetUseCache() *wrappers.BoolValue

func (*QueryOptions) Hash added in v1.9.25

func (m *QueryOptions) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*QueryOptions) ProtoMessage added in v1.9.25

func (*QueryOptions) ProtoMessage()

func (*QueryOptions) ProtoReflect added in v1.9.25

func (x *QueryOptions) ProtoReflect() protoreflect.Message

func (*QueryOptions) Reset added in v1.9.25

func (x *QueryOptions) Reset()

func (*QueryOptions) String added in v1.9.25

func (x *QueryOptions) String() string

type UpstreamSpec

type UpstreamSpec struct {

	// The name of the Consul Service
	ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// Deprecated: This field was renamed to subset_tags. If subset_tags is used, this field is
	// ignored. Otherwise, the behavior is the same as subset_tags field below.
	ServiceTags []string `protobuf:"bytes,2,rep,name=service_tags,json=serviceTags,proto3" json:"service_tags,omitempty"`
	// Gloo will segment instances based off of these tags. This allows you to set routes that route
	// to a subset of the instances of the service
	SubsetTags []string `protobuf:"bytes,6,rep,name=subset_tags,json=subsetTags,proto3" json:"subset_tags,omitempty"`
	// The list of service tags Gloo should search for on a service instance
	// before deciding whether or not to include the instance as part of this
	// upstream. Empty list means that all service instances with the same service name will be
	// included. When not empty, only service instances that match all of the tags (subset match) will be selected
	// for this upstream.
	InstanceTags []string `protobuf:"bytes,7,rep,name=instance_tags,json=instanceTags,proto3" json:"instance_tags,omitempty"`
	// The opposite of instanceTags, this is a list of service tags that gloo should ensure are not
	// in a service instance before including it in an upstream.
	InstanceBlacklistTags []string `` /* 126-byte string literal not displayed */
	// An optional Service Spec describing the service listening at this address
	ServiceSpec *options.ServiceSpec `protobuf:"bytes,3,opt,name=service_spec,json=serviceSpec,proto3" json:"service_spec,omitempty"`
	// Sets the consistency mode. The default is DefaultMode.
	//
	// Note: Gloo handles staleness well (as it runs update loops ~ once/second) but makes many requests
	// to get consul endpoints so users may want to opt into stale reads once the implications are understood.
	ConsistencyMode ConsulConsistencyModes `` /* 140-byte string literal not displayed */
	// QueryOptions are the query options to use for all Consul queries.
	QueryOptions *QueryOptions `protobuf:"bytes,10,opt,name=query_options,json=queryOptions,proto3" json:"query_options,omitempty"`
	// Is this consul service connect enabled.
	ConnectEnabled bool `protobuf:"varint,4,opt,name=connect_enabled,json=connectEnabled,proto3" json:"connect_enabled,omitempty"`
	// The data centers in which the service instance represented by this upstream is registered.
	DataCenters []string `protobuf:"bytes,5,rep,name=data_centers,json=dataCenters,proto3" json:"data_centers,omitempty"`
	// contains filtered or unexported fields
}

Upstream Spec for Consul Upstreams consul Upstreams represent a set of one or more addressable pods for a consul Service the Gloo consul Upstream maps to a single service port. Because consul Services support multiple ports, Gloo requires that a different upstream be created for each port consul Upstreams are typically generated automatically by Gloo from the consul API

func (*UpstreamSpec) Clone added in v1.8.24

func (m *UpstreamSpec) Clone() proto.Message

Clone function

func (*UpstreamSpec) Descriptor deprecated

func (*UpstreamSpec) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec.ProtoReflect.Descriptor instead.

func (*UpstreamSpec) Equal

func (m *UpstreamSpec) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec) GetConnectEnabled

func (x *UpstreamSpec) GetConnectEnabled() bool

func (*UpstreamSpec) GetConsistencyMode added in v1.9.25

func (x *UpstreamSpec) GetConsistencyMode() ConsulConsistencyModes

func (*UpstreamSpec) GetDataCenters

func (x *UpstreamSpec) GetDataCenters() []string

func (*UpstreamSpec) GetInstanceBlacklistTags added in v1.6.0

func (x *UpstreamSpec) GetInstanceBlacklistTags() []string

func (*UpstreamSpec) GetInstanceTags added in v1.3.13

func (x *UpstreamSpec) GetInstanceTags() []string

func (*UpstreamSpec) GetQueryOptions added in v1.9.25

func (x *UpstreamSpec) GetQueryOptions() *QueryOptions

func (*UpstreamSpec) GetServiceName

func (x *UpstreamSpec) GetServiceName() string

func (*UpstreamSpec) GetServiceSpec

func (x *UpstreamSpec) GetServiceSpec() *options.ServiceSpec

func (*UpstreamSpec) GetServiceTags

func (x *UpstreamSpec) GetServiceTags() []string

func (*UpstreamSpec) GetSubsetTags added in v1.3.13

func (x *UpstreamSpec) GetSubsetTags() []string

func (*UpstreamSpec) Hash added in v1.2.13

func (m *UpstreamSpec) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*UpstreamSpec) ProtoMessage

func (*UpstreamSpec) ProtoMessage()

func (*UpstreamSpec) ProtoReflect added in v1.6.0

func (x *UpstreamSpec) ProtoReflect() protoreflect.Message

func (*UpstreamSpec) Reset

func (x *UpstreamSpec) Reset()

func (*UpstreamSpec) String

func (x *UpstreamSpec) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL