roxyutil

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package roxyutil provides miscellaneous utility functions for use by Roxy and by users of mainutil.

As with mainutil, it is undecided how much (if any) of the roxyutil API will remain available outside of the Roxy project once Roxy reaches v1.0.0.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoHealthyBackends      = errors.New("no healthy backends")
	ErrExpectEmpty            = errors.New("expected empty string")
	ErrExpectEmptyOrLocalhost = errors.New("expected empty string or \"localhost\"")
	ErrExpectNonEmpty         = errors.New("expected non-empty string")
	ErrExpectOneSlash         = errors.New("expected one '/', found 2 or more")
	ErrExpectLeadingSlash     = errors.New("expected path to start with '/'")
	ErrExpectTrailingSlash    = errors.New("expected path to end with '/'")
	ErrExpectNoEndSlash       = errors.New("did not expect path to end with '/'")
	ErrExpectNoDoubleSlash    = errors.New("did not expect path to contain '//'")
	ErrExpectNoDot            = errors.New("did not expect path to contain '/./'")
	ErrExpectNoDotDot         = errors.New("did not expect path to contain '/../'")
	ErrFailedToMatch          = errors.New("failed to match expected pattern")
)

Functions

func ExpandPassword

func ExpandPassword(in string) (string, error)

ExpandPassword expands ${ENV_VAR} references and @file references.

func ExpandPath

func ExpandPath(in string) (string, error)

ExpandPath expands ${ENV_VAR} references, ~ and ~user references, and makes the path absolute.

func ExpandString

func ExpandString(in string) (string, error)

ExpandString expands ${ENV_VAR} references.

func ValidateATCLocation

func ValidateATCLocation(str string) error

ValidateATCServiceName validates that the given string is a valid Location for the Air Traffic Control service.

func ValidateATCServiceName

func ValidateATCServiceName(str string) error

ValidateATCServiceName validates that the given string is a valid Service Name for the Air Traffic Control service.

func ValidateATCUnique

func ValidateATCUnique(str string) error

ValidateATCServiceName validates that the given string is a valid Unique ID for the Air Traffic Control service.

func ValidateEtcdPath

func ValidateEtcdPath(str string) error

ValidateEtcdPath validates that the given string is a valid etcd.io V3 key prefix, which must end with a "/".

func ValidateNamedPort

func ValidateNamedPort(str string) error

ValidateNamedPort validates that the given string is a valid named port for a membership.Roxy or membership.ServerSet address advertisement.

func ValidateZKPath

func ValidateZKPath(str string) error

ValidateZKPath validates that the given string is a valid ZooKeeper node path.

Types

type BadATCLocationError

type BadATCLocationError struct {
	Location string
	Err      error
}

func (BadATCLocationError) Error

func (err BadATCLocationError) Error() string

func (BadATCLocationError) Unwrap

func (err BadATCLocationError) Unwrap() error

type BadATCServiceNameError

type BadATCServiceNameError struct {
	ServiceName string
	Err         error
}

func (BadATCServiceNameError) Error

func (err BadATCServiceNameError) Error() string

func (BadATCServiceNameError) Unwrap

func (err BadATCServiceNameError) Unwrap() error

type BadATCUniqueError

type BadATCUniqueError struct {
	Unique string
	Err    error
}

func (BadATCUniqueError) Error

func (err BadATCUniqueError) Error() string

func (BadATCUniqueError) Unwrap

func (err BadATCUniqueError) Unwrap() error

type BadAuthorityError

type BadAuthorityError struct {
	Authority string
	Err       error
}

func (BadAuthorityError) Error

func (err BadAuthorityError) Error() string

func (BadAuthorityError) Unwrap

func (err BadAuthorityError) Unwrap() error

type BadBoolError

type BadBoolError struct {
	Input string
}

func (BadBoolError) Error

func (err BadBoolError) Error() string

type BadEndpointError

type BadEndpointError struct {
	Endpoint string
	Err      error
}

func (BadEndpointError) Error

func (err BadEndpointError) Error() string

func (BadEndpointError) Unwrap

func (err BadEndpointError) Unwrap() error

type BadEnvVarError

type BadEnvVarError struct {
	Var string
}

func (BadEnvVarError) Error

func (err BadEnvVarError) Error() string

func (BadEnvVarError) GRPCStatus

func (err BadEnvVarError) GRPCStatus() *status.Status

func (BadEnvVarError) Is

func (err BadEnvVarError) Is(target error) bool

type BadHostError

type BadHostError struct {
	Host string
	Err  error
}

func (BadHostError) Error

func (err BadHostError) Error() string

func (BadHostError) Unwrap

func (err BadHostError) Unwrap() error

type BadHostPortError

type BadHostPortError struct {
	HostPort string
	Err      error
}

func (BadHostPortError) Error

func (err BadHostPortError) Error() string

func (BadHostPortError) Unwrap

func (err BadHostPortError) Unwrap() error

type BadIPError

type BadIPError struct {
	IP string
}

func (BadIPError) Error

func (err BadIPError) Error() string

type BadPathError

type BadPathError struct {
	Path string
	Err  error
}

func (BadPathError) Error

func (err BadPathError) Error() string

func (BadPathError) Unwrap

func (err BadPathError) Unwrap() error

type BadPortError

type BadPortError struct {
	Port    string
	Err     error
	NamedOK bool
}

func (BadPortError) Error

func (err BadPortError) Error() string

func (BadPortError) Unwrap

func (err BadPortError) Unwrap() error

type BadQueryParamError

type BadQueryParamError struct {
	Name  string
	Value string
	Err   error
}

func (BadQueryParamError) Error

func (err BadQueryParamError) Error() string

func (BadQueryParamError) Unwrap

func (err BadQueryParamError) Unwrap() error

type BadQueryStringError

type BadQueryStringError struct {
	QueryString string
	Err         error
}

func (BadQueryStringError) Error

func (err BadQueryStringError) Error() string

func (BadQueryStringError) Unwrap

func (err BadQueryStringError) Unwrap() error

type BadSchemeError

type BadSchemeError struct {
	Scheme string
	Err    error
}

func (BadSchemeError) Error

func (err BadSchemeError) Error() string

func (BadSchemeError) Unwrap

func (err BadSchemeError) Unwrap() error

type FailedGroupNameLookupError

type FailedGroupNameLookupError struct {
	Name string
	Err  error
}

func (FailedGroupNameLookupError) Error

func (err FailedGroupNameLookupError) Error() string

func (FailedGroupNameLookupError) Unwrap

func (err FailedGroupNameLookupError) Unwrap() error

type FailedMatchError

type FailedMatchError struct {
	Input   string
	Pattern *regexp.Regexp
}

func (FailedMatchError) Error

func (err FailedMatchError) Error() string

type FailedPathAbsError

type FailedPathAbsError struct {
	Path string
	Err  error
}

func (FailedPathAbsError) Error

func (err FailedPathAbsError) Error() string

func (FailedPathAbsError) Unwrap

func (err FailedPathAbsError) Unwrap() error

type FailedUserNameLookupError

type FailedUserNameLookupError struct {
	Name string
	Err  error
}

func (FailedUserNameLookupError) Error

func (err FailedUserNameLookupError) Error() string

func (FailedUserNameLookupError) Unwrap

func (err FailedUserNameLookupError) Unwrap() error

type NotFoundError

type NotFoundError struct {
	Key string
}

func (NotFoundError) Error

func (err NotFoundError) Error() string

func (NotFoundError) GRPCStatus

func (err NotFoundError) GRPCStatus() *status.Status

func (NotFoundError) Is

func (err NotFoundError) Is(target error) bool

Jump to

Keyboard shortcuts

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