Documentation
¶
Index ¶
- Constants
- Variables
- func DataplaneConnectionDialOptions(Token string, meta *proto.Metadata) []grpc.DialOption
- func GetCallOptions() []grpc.CallOption
- func GetCommandChannel(client proto.CommanderClient) (proto.Commander_CommandChannelClient, error)
- func GetCommandClient(conn *grpc.ClientConn) proto.CommanderClient
- func InitMeta(clientID, cloudAccountID string)
- func NewGrpcConnection(target string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error)
- func NewGrpcConnectionWithContext(ctx context.Context, server string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error)
- func NewMessageMeta(messageID string) *sdk.Metadata
- func NewMeta(clientID, messageID, cloudID string) *sdk.Metadata
- func SecureDialOptions(tlsEnabled bool, certPath string, keyPath string, caPath string, ...) (grpc.DialOption, error)
Constants ¶
View Source
const (
DefaultContentChunkSize = 4 * 1024
)
Variables ¶
View Source
var ( // DefaultClientDialOptions are default settings for a connection to the dataplane DefaultClientDialOptions = []grpc.DialOption{ grpc.WithStreamInterceptor(grpc_retry.StreamClientInterceptor()), grpc.WithUnaryInterceptor(grpc_retry.UnaryClientInterceptor()), grpc.WithKeepaliveParams(keepalive.ClientParameters{ Time: 120 * time.Second, Timeout: 60 * time.Second, PermitWithoutStream: true, }), grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt), grpc.MaxCallSendMsgSize(math.MaxInt), ), } DefaultServerDialOptions = []grpc.ServerOption{ grpc.ChainUnaryInterceptor(grpc_validator.UnaryServerInterceptor()), grpc.StreamInterceptor(grpc_validator.StreamServerInterceptor()), grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ MinTime: 60 * time.Second, PermitWithoutStream: true, }), grpc.MaxSendMsgSize(math.MaxInt), grpc.MaxRecvMsgSize(math.MaxInt), } )
Functions ¶
func DataplaneConnectionDialOptions ¶
func DataplaneConnectionDialOptions(Token string, meta *proto.Metadata) []grpc.DialOption
DataplaneConnectionDialOptions returns dialOptions for connecting to a dataplane instance
func GetCommandChannel ¶
func GetCommandChannel(client proto.CommanderClient) (proto.Commander_CommandChannelClient, error)
GetCommandChannel returns a channel that commands are sent over
func GetCommandClient ¶
func GetCommandClient(conn *grpc.ClientConn) proto.CommanderClient
GetCommandClient returns a commanderClient with that grpc connection
func NewGrpcConnection ¶
func NewGrpcConnection(target string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error)
NewGrpcConnection -
func NewGrpcConnectionWithContext ¶
func NewGrpcConnectionWithContext(ctx context.Context, server string, dialOptions []grpc.DialOption) (*grpc.ClientConn, error)
NewGrpcConnectionWithContext -
func NewMessageMeta ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.