util

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufPool = bufferPool{
	sync.Pool{
		New: func() interface{} {
			return bytes.NewBuffer(nil)
		},
	},
}
View Source
var (
	ERR_NO_LOGIN = errors.New("No server configuration found. Did you login?")
)

Functions

func CheckErr

func CheckErr(err error, check error) bool

func CheckFieldErr

func CheckFieldErr(err error, field, val string) bool

func GenerateRandomByteArray

func GenerateRandomByteArray(length int) []byte

func GenerateRandomToken

func GenerateRandomToken(length int) string

func GetServerVersion

func GetServerVersion() string

func GetStack

func GetStack(err error) string

func GetVersion

func GetVersion() string

func GetWebVersion

func GetWebVersion() string

func NewError

func NewError(inner string) error

func NewErrorFields

func NewErrorFields() error

func NewErrorFrom

func NewErrorFrom(err error) error

func NewErrorf

func NewErrorf(f string, v ...interface{}) error

func WrapSkip

func WrapSkip(err error, skip int) error

func WriteStringToWriter

func WriteStringToWriter(w io.Writer, s string) error

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Camo

func (e *Error) Camo() error

func (Error) Empty

func (e Error) Empty() bool

func (Error) Error

func (e Error) Error() string

func (Error) ErrorWithStack

func (e Error) ErrorWithStack() string

func (*Error) Inner

func (e *Error) Inner() error

func (Error) MarshalJSON

func (r Error) MarshalJSON() ([]byte, error)

func (*Error) Match

func (e *Error) Match(o error) bool

func (*Error) MultiStack

func (e *Error) MultiStack() *stack.Multi

func (*Error) SetErrorOrCamo

func (e *Error) SetErrorOrCamo(err error) error

func (*Error) SetFieldError

func (e *Error) SetFieldError(f, er string)

type VersionEntry

type VersionEntry struct {
	Commit string       `json:"commit"`
	Date   *VersionTime `json:"date"`
	Behind int          `json:"-"`
}

func GetVersionInfo

func GetVersionInfo(cid string) (*VersionEntry, error)

type VersionTime

type VersionTime time.Time

func (*VersionTime) UnmarshalJSON

func (vt *VersionTime) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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