Documentation
¶
Index ¶
- Constants
- func Connection(addr string, creds credentials.TransportCredentials) (*grpc.ClientConn, error)
- func Flags(configFilePath altsrc.StringSourcer) []cli.Flag
- func LinkData(ctx context.Context, grpcAddr string, creds credentials.TransportCredentials, ...) (string, map[string]string, error)
- func SecureCreds(cmd *cli.Command) credentials.TransportCredentials
Constants ¶
View Source
const (
DefaultGRPCAddress = "localhost:14460"
)
Variables ¶
This section is empty.
Functions ¶
func Connection ¶
func Connection(addr string, creds credentials.TransportCredentials) (*grpc.ClientConn, error)
Connection creates a gRPC client connection to the given Thrippy server address. It supports both secure and insecure connections, based on the given credentials.
func Flags ¶
func Flags(configFilePath altsrc.StringSourcer) []cli.Flag
Flags defines CLI flags to configure a Thrippy gRPC client. These flags can also be set using environment variables and the application's configuration file.
func LinkData ¶
func LinkData(ctx context.Context, grpcAddr string, creds credentials.TransportCredentials, linkID string) (string, map[string]string, error)
LinkData returns the template name and saved secrets of a given Thrippy link. This function reports gRPC errors, but if the link is not found it returns nil.
func SecureCreds ¶
func SecureCreds(cmd *cli.Command) credentials.TransportCredentials
SecureCreds initializes gRPC client credentials, using TLS or mTLS, based on CLI flags. Errors abort the application with a log message.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.