utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidden = errors.New("forbidden")
View Source
var ErrInvalid = errors.New("invalid input")
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrUnauthorized = errors.New("unauthorized")

Functions

func DumpObject added in v0.4.0

func DumpObject(c interface{})

DumpObject pretty prints any object to the standard output. Only used for debug.

func EnsureSysAdmin added in v0.3.0

func EnsureSysAdmin(mm *pluginapi.Client, userID string) error

func FindDir added in v0.2.0

func FindDir(dir string) (string, bool)

FindDir looks for the given directory in nearby ancestors relative to the current working directory as well as the directory of the executable, falling back to `./` if not found.

func LoadSession added in v0.3.0

func LoadSession(mm *pluginapi.Client, sessionID, actingUserID string) (*model.Session, error)

func NewError added in v0.3.0

func NewError(source error, args ...interface{}) error

func NewForbiddenError added in v0.3.0

func NewForbiddenError(args ...interface{}) error

func NewInvalidError added in v0.3.0

func NewInvalidError(args ...interface{}) error

func NewNotFoundError added in v0.3.0

func NewNotFoundError(args ...interface{}) error

func NewUnauthorizedError added in v0.3.0

func NewUnauthorizedError(args ...interface{}) error

func ToJSON

func ToJSON(in interface{}) string

Types

type ByteSize

type ByteSize int64

func ParseByteSize

func ParseByteSize(str string) (ByteSize, error)

func (ByteSize) String

func (size ByteSize) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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