{"modulePath":"github.com/codedellemc/libstorage","version":"v0.6.3","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package utils\n\n## Functions\n\n```go\nfunc DeviceAttachTimeout(val string) time.Duration\n```\nDeviceAttachTimeout gets the configured device attach timeout.\n\n```go\nfunc GetTempSockFile(ctx types.Context) string\n```\nGetTempSockFile returns a new sock file in a temp space.\n\n```go\nfunc GetTypePkgPathAndName(i interface{}) string\n```\nGetTypePkgPathAndName gets ths type and package path of the provided instance.\n\n```go\nfunc HostName() (string, error)\n```\nHostName returns then host name.\n\n```go\nfunc NewBadAdminTokenError(token string) error\n```\nNewBadAdminTokenError returns a new ErrBadAdminToken error.\n\n```go\nfunc NewBadFilterErr(filter string, err error) error\n```\nNewBadFilterErr returns a new ErrBadFilter error.\n\n```go\nfunc NewBatchProcessErr(completed interface{}, err error) error\n```\nNewBatchProcessErr returns a new ErrBatchProcess error.\n\n```go\nfunc NewDriverTypeErr(expectedType, actualType string) error\n```\nNewDriverTypeErr returns a new ErrDriverTypeErr error.\n\n```go\nfunc NewMissingInstanceIDError(service string) error\n```\nNewMissingInstanceIDError returns a new ErrMissingInstanceID error.\n\n```go\nfunc NewMissingLocalDevicesError(service string) error\n```\nNewMissingLocalDevicesError returns a new ErrMissingLocalDevices error.\n\n```go\nfunc NewNotFoundError(resourceID string) error\n```\nNewNotFoundError returns a new ErrNotFound error.\n\n```go\nfunc NewPathConfig(ctx types.Context, args ...string) *types.PathConfig\n```\nNewPathConfig returns a new path configuration object.\n\nThe args parameter can take zero to three arguments:\n\n 1. The first argument is treated as a custom root, data directory path. This defaults root path is \"/\".\n\n 2. The second argument is treated as a custom application token. This is used to brand libStorage's paths, files, and environment variables. The default application token is \"libstorage\".\n\n 3. The third argument is treated as a custom home directory for the executing process's user. The default value is the user's home directory.\n\n```go\nfunc NewStore() types.Store\n```\nNewStore initializes a new instance of the Store type.\n\n```go\nfunc NewStoreKeyErr(key string) error\n```\nNewStoreKeyErr returns a new ErrStoreKey error.\n\n```go\nfunc NewStoreWithData(data map[string]interface{}) types.Store\n```\nNewStoreWithData initializes a new instance of the Store type.\n\n```go\nfunc NewStoreWithVars(vars map[string]string) types.Store\n```\nNewStoreWithVars initializes a new instance of the Store type.\n\n```go\nfunc NewTTLStore(duration time.Duration, hardLimit bool) types.Store\n```\nNewTTLStore initializes a new instance of the Store type, but has a TTL that expires contents after a specific duration. The parameter hardLimit can be set to true to change the TTL from a sliding expiration to a hard limit.\n\n```go\nfunc NewUnsupportedForClientTypeError(\n\tclientType types.ClientType, op string) error\n```\nNewUnsupportedForClientTypeError returns a new ErrUnsupportedForClientType error.\n\n```go\nfunc ParseAuthConfig(\n\tctx types.Context,\n\tconfig gofig.Config,\n\tfields log.Fields,\n\troots ...string) (*types.AuthConfig, error)\n```\nParseAuthConfig returns a new AuthTokenConfig instance.\n\n```go\nfunc ParseKnownHost(\n\tctx types.Context,\n\ttext string) (*types.TLSKnownHost, error)\n```\nParseKnownHost parses a known host line that's in the expected format: \"host algorithm fingerprint\".\n\n```go\nfunc ParseTLSConfig(\n\tctx types.Context,\n\tconfig gofig.Config,\n\tproto string,\n\tfields log.Fields,\n\troots ...string) (tlsConfig *types.TLSConfig, tlsErr error)\n```\nParseTLSConfig returns a new TLS configuration.\n\n```go\nfunc SortByString(strings []string) []string\n```\nSortByString sorts the strings.\n\n```go\nfunc SortVolumeByID(volumes []*types.Volume) []*types.Volume\n```\nSortVolumeByID sorts the volumes by their IDs.\n\n```go\nfunc WaitFor(\n\tf func() (interface{}, error),\n\ttimeout time.Duration) (interface{}, bool, error)\n```\nWaitFor waits for a lambda to complete or aborts after a specified amount of time. If the function fails to complete in the specified amount of time then the second return value is a boolean false. Otherwise the return value and possible error of the provided lambda are returned.\n\n## Types\n\n```go\ntype ByString []string\n```\nByString  implements sort.Interface for \\[]string.\n\n```go\nfunc (a ByString) Len() int\n```\n\n```go\nfunc (a ByString) Less(i, j int) bool\n```\n\n```go\nfunc (a ByString) Swap(i, j int)\n```\n\n```go\ntype ByVolumeID []*types.Volume\n```\nByVolumeID implements sort.Interface for \\[]\\*types.Volume based on the ID field.\n\n```go\nfunc (a ByVolumeID) Len() int\n```\n\n```go\nfunc (a ByVolumeID) Less(i, j int) bool\n```\n\n```go\nfunc (a ByVolumeID) Swap(i, j int)\n```\n\n```go\ntype LoggingConfig struct {\n\n\t// Level is the log level.\n\tLevel log.Level\n\n\t// Stdout is the path to the file to which to log stdout.\n\tStdout string\n\n\t// Stderr is the path to the file to which to log stderr.\n\tStderr string\n\n\t// HTTPRequests is a flag indicating whether or not to log HTTP requests.\n\tHTTPRequests bool\n\n\t// HTTPResponses is a flag indicating whether or not to log HTTP responses.\n\tHTTPResponses bool\n}\n```\nLoggingConfig is the logging configuration.\n\n```go\nfunc ParseLoggingConfig(\n\tconfig gofig.Config,\n\tfields log.Fields,\n\troots ...string) (*LoggingConfig, error)\n```\nParseLoggingConfig returns a new LoggingConfig instance.\n\n","path":"github.com/codedellemc/libstorage/api/utils","name":"utils","synopsis":"","isRedistributable":true}
