Documentation ¶
Index ¶
- Constants
- Variables
- func CheckGrpcError(err error)
- func CloseConnections()
- func GetBaseGrpcMetadata() metadata.MD
- func GetTokenCacheFilePath() (string, error)
- func InitClient()
- func PromptConfirm(msg string) bool
- func ReadPasswordFromEnv() (string, bool)
- func ReadTokenFromCache(filePath string) (string, error)
- func WriteTokenCache(filePath string, token string) error
Constants ¶
View Source
const DBFlagMsg string = "The database to use. If not present, the default database is used"
View Source
const ( // ValueNone is a special value for values that do not exist. ValueNone string = "(None)" )
Variables ¶
View Source
var ( GrpcEchoClient echopb.EchoServiceClient GrpcAuthClient authpb.AuthServiceClient GrpcServerClient serverpb.ServerServiceClient GrpcDBClient dbpb.DBServiceClient GrpcGeneralKVClient kvpb.GeneralKVServiceClient GrpcStringKVClient kvpb.StringKVServiceClient GrpcHashMapKVClient kvpb.HashMapKVServiceClient )
Functions ¶
func CheckGrpcError ¶
func CheckGrpcError(err error)
CheckGrpcError checks if error is a gRPC error. Prints error with the gRPC status message if it is. Otherwise prints the error if it is not nil.
func CloseConnections ¶
func CloseConnections()
CloseConnections closes all connections to the server.
func GetBaseGrpcMetadata ¶
GetBaseGrpcMetadata returns base gRPC metadata for all requests. It can be overwritten or extended.
func GetTokenCacheFilePath ¶
func PromptConfirm ¶
Prompts user a confirm message and reads input. The input should be of type Yes/No. Returns true if the user entered Yes.
func ReadPasswordFromEnv ¶
ReadPasswordFromEnv reads password from environment variable. The returned bool is true if it is present.
func ReadTokenFromCache ¶
func WriteTokenCache ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.