client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

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

func GetBaseGrpcMetadata() metadata.MD

GetBaseGrpcMetadata returns base gRPC metadata for all requests. It can be overwritten or extended.

func GetTokenCacheFilePath

func GetTokenCacheFilePath() (string, error)

func InitClient

func InitClient()

InitClient initializes the client and connections.

func PromptConfirm

func PromptConfirm(msg string) bool

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

func ReadPasswordFromEnv() (string, bool)

ReadPasswordFromEnv reads password from environment variable. The returned bool is true if it is present.

func ReadTokenFromCache

func ReadTokenFromCache(filePath string) (string, error)

func WriteTokenCache

func WriteTokenCache(filePath string, token string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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