commons

package
v0.0.0-...-015ad48 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthInfo

func NewAuthInfo(result *altsproto.HandshakerResult) credentials.AuthInfo

New returns a new altsAuthInfo object given handshaker results.

func NewClientHandshaker

func NewClientHandshaker(ctx context.Context, conn *grpc.ClientConn, c net.Conn, opts *ClientHandshakerOptions) (internal.Handshaker, error)

func NewServerHandshaker

func NewServerHandshaker(ctx context.Context, conn *grpc.ClientConn, c net.Conn, opts *ServerHandshakerOptions) (internal.Handshaker, error)

func ResetConcurrentHandshakeSemaphoreForTesting

func ResetConcurrentHandshakeSemaphoreForTesting(numberOfAllowedHandshakes int64)

ResetConcurrentHandshakeSemaphoreForTesting resets the handshake semaphores to allow numberOfAllowedHandshakes concurrent handshakes each.

Types

type ClientHandshakerOptions

type ClientHandshakerOptions struct {
	ClientIdentity        *altsproto.Identity
	TargetName            string
	TargetServiceAccounts []string
	RPCVersions           *altsproto.RpcProtocolVersions
	ServiceName           string
}

ClientHandshakerOptions contains the client handshaker options that can provided by the caller.

func DefaultClientHandshakerOptions

func DefaultClientHandshakerOptions(serviceName string) *ClientHandshakerOptions

DefaultClientHandshakerOptions returns the default client handshaker options.

type ServerHandshakerOptions

type ServerHandshakerOptions struct {
	RPCVersions           *altsproto.RpcProtocolVersions
	TargetServiceAccounts []string
	ServiceName           string
}

ServerHandshakerOptions contains the server handshaker options that can provided by the caller.

func DefaultServerHandshakerOptions

func DefaultServerHandshakerOptions(serviceName string) *ServerHandshakerOptions

DefaultServerHandshakerOptions returns the default client handshaker options.

Jump to

Keyboard shortcuts

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