utils

package
v0.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReservedNCS       byte = 0x80
	ReservedRFC4122   byte = 0x40
	ReservedMicrosoft byte = 0x20
	ReservedFuture    byte = 0x00
)

The UUID reserved variants.

Variables

This section is empty.

Functions

func DeviceAttachTimeout

func DeviceAttachTimeout(val string) time.Duration

DeviceAttachTimeout gets the configured device attach timeout.

func GetTempSockFile

func GetTempSockFile() string

GetTempSockFile returns a new sock file in a temp space.

func GetTypePkgPathAndName

func GetTypePkgPathAndName(i interface{}) string

GetTypePkgPathAndName gets ths type and package path of the provided instance.

func HostName

func HostName() (string, error)

HostName returns then host name.

func NewBadFilterErr

func NewBadFilterErr(filter string, err error) error

NewBadFilterErr returns a new ErrBadFilter error.

func NewBatchProcessErr

func NewBatchProcessErr(completed interface{}, err error) error

NewBatchProcessErr returns a new ErrBatchProcess error.

func NewContextErr

func NewContextErr(key types.ContextKey) error

NewContextErr returns a new ErrContextKey error.

func NewContextKeyErr

func NewContextKeyErr(key types.ContextKey) error

NewContextKeyErr returns a new ErrContextKey error.

func NewContextTypeErr

func NewContextTypeErr(
	contextKey types.ContextKey, expectedType, actualType string) error

NewContextTypeErr returns a new ErrContextType error.

func NewDriverTypeErr

func NewDriverTypeErr(expectedType, actualType string) error

NewDriverTypeErr returns a new ErrDriverTypeErr error.

func NewMissingInstanceIDError

func NewMissingInstanceIDError(service string) error

NewMissingInstanceIDError returns a new ErrMissingInstanceID error.

func NewNotFoundError

func NewNotFoundError(resourceID string) error

NewNotFoundError returns a new ErrNotFound error.

func NewStore

func NewStore() types.Store

NewStore initializes a new instance of the Store type.

func NewStoreKeyErr

func NewStoreKeyErr(key string) error

NewStoreKeyErr returns a new ErrStoreKey error.

func NewStoreWithData

func NewStoreWithData(data map[string]interface{}) types.Store

NewStoreWithData initializes a new instance of the Store type.

func NewStoreWithVars

func NewStoreWithVars(vars map[string]string) types.Store

NewStoreWithVars initializes a new instance of the Store type.

func NewTTLStore

func NewTTLStore(duration time.Duration, hardLimit bool) types.Store

NewTTLStore 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.

func ParseTLSConfig

func ParseTLSConfig(
	config gofig.Config, fields log.Fields) (*tls.Config, error)

ParseTLSConfig returns a new TLS configuration.

func SortByString

func SortByString(strings []string) []string

SortByString sorts the strings.

func SortVolumeByID

func SortVolumeByID(volumes []*types.Volume) []*types.Volume

SortVolumeByID sorts the volumes by their IDs.

Types

type ByString

type ByString []string

ByString implements sort.Interface for []string.

func (ByString) Len

func (a ByString) Len() int

func (ByString) Less

func (a ByString) Less(i, j int) bool

func (ByString) Swap

func (a ByString) Swap(i, j int)

type ByVolumeID

type ByVolumeID []*types.Volume

ByVolumeID implements sort.Interface for []*types.Volume based on the ID field.

func (ByVolumeID) Len

func (a ByVolumeID) Len() int

func (ByVolumeID) Less

func (a ByVolumeID) Less(i, j int) bool

func (ByVolumeID) Swap

func (a ByVolumeID) Swap(i, j int)

type UUID

type UUID [16]byte

UUID is a UUID. This was totally stolen from https://github.com/nu7hatch/gouuid/blob/master/uuid.go, and all credit goes to that author. It was included like this in order to reduce external dependencies.

func NewUUID

func NewUUID() (*UUID, error)

NewUUID returns a new UUID.

func (*UUID) String

func (u *UUID) String() string

String returns unparsed version of the generated UUID sequence.

Directories

Path Synopsis
Package filters is a piece of thievery as the LDAP filter parsing code was lifted serepticiously from https://github.com/tonnerre/go-ldap/blob/master/ldap.go.
Package filters is a piece of thievery as the LDAP filter parsing code was lifted serepticiously from https://github.com/tonnerre/go-ldap/blob/master/ldap.go.

Jump to

Keyboard shortcuts

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