Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { AddCommand(context.Context, *proto.BotCommand) (*empty.Empty, error) GetCommand(context.Context, *proto.Command) (*proto.BotCommand, error) ListCommands(context.Context, *empty.Empty) (*proto.BotCommands, error) UpdateCommand(context.Context, *proto.BotCommand) (*empty.Empty, error) DeleteCommand(context.Context, *proto.Command) (*empty.Empty, error) }
Client represents a gRPC BotioCLient with basic CRUD methods.
type ConnOption ¶
type ConnOption func() (*grpc.ClientConn, error)
ConnOption represents a connection option for a new Client.
func WithInsecureConn ¶
func WithInsecureConn(url string) ConnOption
WithInsecureConn receives an URL and creates a new non-secured connection that it will be assigned to a new Client at the moment of its creation. If something goes wrong while creating the insecure connection it returns a non-nil error.
func WithTLSSecureConn ¶
func WithTLSSecureConn(url, server, crt, key, ca string) ConnOption
WithTLSSecureConn receives an URL and SSL related filenames and creates a TLS secured connection that it will be assigned to a new Client at the moment of its creation. If something goes wrong while loading the TLS configuration or while reading the received certificates it will return a non-nil error.