Documentation ¶
Index ¶
- Constants
- func BytesToMegabytes(bytes uint64) float64
- func CreateDirectoriesInDirPath(dirPath string) error
- func CreateFileIfNotExist(filePath string) error
- func GetDirPath(parent string, dirName string) (string, error)
- func GetExecParentDirPath() (string, error)
- func GetExecPath() (string, error)
- func ReadFileLines(filePath string) ([]string, error)
- func StringInSlice(target string, slice []string) bool
Constants ¶
View Source
const ( // GrpcMetadataKeyDbName is the gRPC metadata key for database. GrpcMetadataKeyDbName string = "database" // GrpcMetadataKeyAPIVersion is the gRPC metadata key for API version. GrpcMetadataKeyAPIVersion string = "api-version" // GrpcMetadataKeyAuthToken is the gRPC metadata key for authentication token. GrpcMetadataKeyAuthToken string = "auth-token" )
View Source
const ( // ServerDefaultHost is the default address of the server. ServerDefaultHost string = "localhost" // ServerDefaultPort is the default port of the server. ServerDefaultPort uint16 = 12345 // DbMaxKeyCount is the maximum number of keys a database can hold. DbMaxKeyCount uint32 = math.MaxUint32 // HashMapMaxFields is the maximum number of fields a HashMap can hold. HashMapMaxFields uint32 = math.MaxUint32 // DefaultMaxClientConnections is the maximum number of client connections. DefaultMaxClientConnections uint32 = 1000 )
Variables ¶
This section is empty.
Functions ¶
func BytesToMegabytes ¶
func CreateFileIfNotExist ¶
CreateFileIfNotExist creates a file if it doesn't exist.
func GetDirPath ¶
GetDirPath gets path to a directory and returns it. parent is the parent directory and dirName the name of the directory. Creates the directory if it does not exist.
func GetExecParentDirPath ¶
GetExecParentDirPath returns the absolute path of the executable's parent directory.
func GetExecPath ¶
GetExecPath returns the absolute path of the executable.
func ReadFileLines ¶
ReadFileLines reads a file and returns its lines
func StringInSlice ¶
StringInSlice returns true if passed slice contains target.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.