Documentation ¶
Overview ¶
Package grpc contains utilities for interacting with CloudVision's gRPC APIs
Package grpc contains utilities for interacting with CloudVision's gRPC APIs
Index ¶
- Constants
- Variables
- func DialWithAuth(ctx context.Context, target string, auth *Auth, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func DialWithToken(ctx context.Context, target, token string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func NewAccessTokenCredential(token string) credentials.PerRPCCredentials
- func TLSConfig() *tls.Config
- type Auth
Constants ¶
const AuthFlagUsage = "Authentication scheme used to connect to CloudVision. " +
"Possible values\n:" +
"\t\"token,{token_file}[,{ca_file}]\": client-side certificate with token-based " +
"authentication. Uses host's root CA if {ca_file} is not provided.\n"
AuthFlagUsage indicates how to use the authentication config flag.
Variables ¶
var ErrNoClusterTargets = errors.New("no redirection cluster targets")
ErrNoClusterTargets is returned when no clusters are returned.
Functions ¶
func DialWithAuth ¶
func DialWithAuth(ctx context.Context, target string, auth *Auth, opts ...grpc.DialOption) ( *grpc.ClientConn, error)
DialWithAuth dials a gRPC endpoint, target, with the provided authentication config and dial options.
func DialWithToken ¶
func DialWithToken(ctx context.Context, target, token string, opts ...grpc.DialOption) ( *grpc.ClientConn, error)
DialWithToken dials a gRPC endpoint, target, with the provided token and dial options.
func NewAccessTokenCredential ¶
func NewAccessTokenCredential(token string) credentials.PerRPCCredentials
NewAccessTokenCredential constructs a new per-RPC credential from a token.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth holds an authentication scheme used to connect to CloudVision.
func AuthFlag ¶
func AuthFlag() *Auth
AuthFlag adds an authentication config flag with the name "auth".
func NewTokenAuth ¶
NewTokenAuth creates a new token authentication config. If caFile is not provided, the host's root CA will be used.
func (*Auth) ClientCredentials ¶
func (a *Auth) ClientCredentials() ([]grpc.DialOption, error)
ClientCredentials returns dial options corresponding to the client credentials.