grpc: google.golang.org/grpc/internal/resolver Index | Files | Directories

package resolver

import "google.golang.org/grpc/internal/resolver"

Package resolver provides internal resolver-related functionality.

Index

Package Files

config_selector.go

func SetConfigSelector Uses

func SetConfigSelector(state resolver.State, cs ConfigSelector) resolver.State

SetConfigSelector sets the config selector in state and returns the new state.

type ConfigSelector Uses

type ConfigSelector interface {
    // Selects the configuration for the RPC, or terminates it using the error.
    // This error will be converted by the gRPC library to a status error with
    // code UNKNOWN if it is not returned as a status error.
    SelectConfig(RPCInfo) (*RPCConfig, error)
}

ConfigSelector controls what configuration to use for every RPC.

func GetConfigSelector Uses

func GetConfigSelector(state resolver.State) ConfigSelector

GetConfigSelector retrieves the config selector from state, if present, and returns it or nil if absent.

type RPCConfig Uses

type RPCConfig struct {
    // The context to use for the remainder of the RPC; can pass info to LB
    // policy or affect timeout or metadata.
    Context      context.Context
    MethodConfig serviceconfig.MethodConfig // configuration to use for this RPC
    OnCommitted  func()                     // Called when the RPC has been committed (retries no longer possible)
}

RPCConfig describes the configuration to use for each RPC.

type RPCInfo Uses

type RPCInfo struct {
    // Context is the user's context for the RPC and contains headers and
    // application timeout.  It is passed for interception purposes and for
    // efficiency reasons.  SelectConfig should not be blocking.
    Context context.Context
    Method  string // i.e. "/Service/Method"
}

RPCInfo contains RPC information needed by a ConfigSelector.

type SafeConfigSelector Uses

type SafeConfigSelector struct {
    // contains filtered or unexported fields
}

SafeConfigSelector allows for safe switching of ConfigSelector implementations such that previous values are guaranteed to not be in use when UpdateConfigSelector returns.

func (*SafeConfigSelector) SelectConfig Uses

func (scs *SafeConfigSelector) SelectConfig(r RPCInfo) (*RPCConfig, error)

SelectConfig defers to the current ConfigSelector in scs.

func (*SafeConfigSelector) UpdateConfigSelector Uses

func (scs *SafeConfigSelector) UpdateConfigSelector(cs ConfigSelector)

UpdateConfigSelector swaps to the provided ConfigSelector and blocks until all uses of the previous ConfigSelector have completed.

Directories

PathSynopsis
dnsPackage dns implements a dns resolver to be installed as the default resolver in grpc.
passthroughPackage passthrough implements a pass-through resolver.
unixPackage unix implements a resolver for unix targets.

Package resolver imports 4 packages (graph) and is imported by 3 packages. Updated 2020-12-26. Refresh now. Tools for package owners.