Documentation ¶
Index ¶
- func ContextWithQueryOptions(ctx context.Context, options structs.QueryOptions) (context.Context, error)
- func ForwardMetadataContext(ctx context.Context) context.Context
- func GRPCMetadataFromQueryMeta(queryMeta structs.QueryMeta) (metadata.MD, error)
- func NewServer(logger agentmiddleware.Logger, metricsObj *metrics.Metrics, ...) *grpc.Server
- func QueryMetaFromGRPCMeta(md metadata.MD) (structs.QueryMeta, error)
- func QueryOptionsFromContext(ctx context.Context) (structs.QueryOptions, error)
- func RequireAnyValidACLToken(resolver ACLResolver, token string) error
- func StringToQueryBackendDecodeHookFunc(f reflect.Type, t reflect.Type, data any) (any, error)
- func TraceID() string
- type ACLResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithQueryOptions ¶ added in v1.14.0
func ContextWithQueryOptions(ctx context.Context, options structs.QueryOptions) (context.Context, error)
ContextWithQueryOptions returns a context with the given query options attached.
func GRPCMetadataFromQueryMeta ¶ added in v1.14.8
GRPCMetadataFromQueryMeta returns a metadata struct with fields from the structs.QueryMeta attached. The return value is suitable for attaching to a gRPC header/trailer.
func NewServer ¶
func NewServer(logger agentmiddleware.Logger, metricsObj *metrics.Metrics, tls *tlsutil.Configurator) *grpc.Server
NewServer constructs a gRPC server for the external gRPC port, to which handlers can be registered.
func QueryMetaFromGRPCMeta ¶ added in v1.14.8
QueryMetaFromGRPCMeta returns a structs.QueryMeta struct parsed from the metadata.MD, such as from a gRPC header or trailer.
func QueryOptionsFromContext ¶ added in v1.14.0
func QueryOptionsFromContext(ctx context.Context) (structs.QueryOptions, error)
QueryOptionsFromContext returns the query options in the gRPC metadata attached to the given context.
func RequireAnyValidACLToken ¶ added in v1.14.4
func RequireAnyValidACLToken(resolver ACLResolver, token string) error
RequireAnyValidACLToken checks that the caller provided a valid ACL token without requiring any specific permissions. This is useful for endpoints that are used by all/most consumers of our API, such as those called by the consul-server-connection-manager library when establishing a new connection.
Note: no token is required if ACLs are disabled.
func StringToQueryBackendDecodeHookFunc ¶ added in v1.14.8
Types ¶
type ACLResolver ¶ added in v1.14.4
type ACLResolver interface {
ResolveTokenAndDefaultMeta(string, *acl.EnterpriseMeta, *acl.AuthorizerContext) (resolver.Result, error)
}
Directories ¶
Path | Synopsis |
---|---|
package limiter provides primatives for limiting the number of concurrent operations in-flight.
|
package limiter provides primatives for limiting the number of concurrent operations in-flight. |
services
|
|