apufferi

package module
v4.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 13 Imported by: 18

Documentation

Index

Constants

View Source
const MaxRecursivePath = 256

Variables

This section is empty.

Functions

func Close

func Close(closer io.Closer)

func ContainsScope

func ContainsScope(arr []scope.Scope, value scope.Scope) bool

func ContainsString

func ContainsString(arr []string, value string) bool

func Convert

func Convert(val interface{}, target interface{}) (interface{}, error)

Converts the val parameter to the same type as the target

func CopyFile

func CopyFile(src, dest string) error

func EnsureAccess

func EnsureAccess(source string, prefix string) bool

func GetBooleanOrDefault

func GetBooleanOrDefault(data map[string]interface{}, key string, def bool) bool

func GetMapOrNull

func GetMapOrNull(data map[string]interface{}, key string) map[string]interface{}

func GetObjectArrayOrNull

func GetObjectArrayOrNull(data map[string]interface{}, key string) []interface{}

func GetStringArrayOrNull

func GetStringArrayOrNull(data map[string]interface{}, key string) []string

func GetStringOrDefault

func GetStringOrDefault(data map[string]interface{}, key string, def string) string

func JoinPath

func JoinPath(paths ...string) string
func RemoveInvalidSymlinks(files []os.FileInfo, sourceFolder, prefix string) []os.FileInfo

func ReplaceTokens

func ReplaceTokens(msg string, mapping map[string]interface{}) string

func ReplaceTokensInArr

func ReplaceTokensInArr(msg []string, mapping map[string]interface{}) []string

func ReplaceTokensInMap

func ReplaceTokensInMap(msg map[string]string, mapping map[string]interface{}) map[string]string

func ToString

func ToString(v interface{}) string

func UnmarshalTo added in v4.0.3

func UnmarshalTo(source, target interface{}) error

Types

type Cache

type Cache interface {
	Read() (cache []string, epoch int64)

	ReadFrom(startTime int64) (cache []string, epoch int64)

	Write(b []byte) (n int, err error)
}

type Claim

type Claim struct {
	jwt.StandardClaims
	PanelClaims PanelClaims `json:"pufferpanel,omitempty"`
}

type Error

type Error struct {
	Message string                 `json:"msg,omitempty"`
	Code    string                 `json:"code,omitempty"`
	Meta    map[string]interface{} `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func CreateError

func CreateError(msg, code string) *Error

func FromError

func FromError(err error) *Error

func (*Error) Error

func (ge *Error) Error() string

func (*Error) GetCode

func (ge *Error) GetCode() string

func (*Error) GetMessage

func (ge *Error) GetMessage() string

func (*Error) Is

func (ge *Error) Is(err *Error) bool

func (*Error) Metadata

func (ge *Error) Metadata(metadata map[string]interface{}) *Error

type Execution

type Execution struct {
	Arguments               []string          `json:"arguments,omitempty"`
	ProgramName             string            `json:"program,omitempty"`
	StopCommand             string            `json:"stop,omitempty"`
	Disabled                bool              `json:"disabled,omitempty"`
	AutoStart               bool              `json:"autostart,omitempty"`
	AutoRestartFromCrash    bool              `json:"autorecover,omitempty"`
	AutoRestartFromGraceful bool              `json:"autorestart,omitempty"`
	PreExecution            []interface{}     `json:"pre,omitempty"`
	PostExecution           []interface{}     `json:"post,omitempty"`
	StopCode                int               `json:"stopCode,omitempty"`
	EnvironmentVariables    map[string]string `json:"environmentVars,omitempty"`
}

type MemoryCache

type MemoryCache struct {
	Cache
	Buffer   []Message
	Capacity int
}

func (*MemoryCache) Read

func (c *MemoryCache) Read() (msg []string, lastTime int64)

func (*MemoryCache) ReadFrom

func (c *MemoryCache) ReadFrom(startTime int64) (msg []string, lastTime int64)

func (*MemoryCache) Write

func (c *MemoryCache) Write(b []byte) (n int, err error)

type Message

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

type MetadataType added in v4.0.3

type MetadataType struct {
	Type     string                 `json:"type,omitempty"`
	Metadata map[string]interface{} `json:"-,omitempty"`
}

designed to be overridden

func (*MetadataType) MarshalJSON added in v4.0.3

func (t *MetadataType) MarshalJSON() ([]byte, error)

func (*MetadataType) ParseMetadata added in v4.0.3

func (t *MetadataType) ParseMetadata(target interface{}) (err error)

Parses the metadata into the target interface

func (*MetadataType) UnmarshalJSON added in v4.0.3

func (t *MetadataType) UnmarshalJSON(bs []byte) (err error)

parses a type with this declaration, storing what it needs into metadata and type

type PanelClaims

type PanelClaims struct {
	Scopes map[string][]scope.Scope `json:"scopes"`
}

type Server

type Server struct {
	Variables      map[string]Variable `json:"data,omitempty"`
	Display        string              `json:"display,omitempty"`
	Environment    interface{}         `json:"environment,omitempty"`
	Installation   []interface{}       `json:"install,omitempty"`
	Uninstallation []interface{}       `json:"uninstall,omitempty"`
	Type           string              `json:"type,omitempty"`
	Identifier     string              `json:"id,omitempty"`
	Execution      Execution           `json:"run,omitempty"`
}

type Template

type Template struct {
	Server
	SupportedEnvironments []interface{} `json:"supportedEnvironments,omitEmpty"`
}

type Token

type Token struct {
	*jwt.Token
	Claims *Claim
}

func ParseToken

func ParseToken(publicKey *ecdsa.PublicKey, token string) (*Token, error)

type Type added in v4.0.3

type Type struct {
	Type string `json:"type"`
}

type Variable

type Variable struct {
	Description  string           `json:"desc,omitempty"`
	Display      string           `json:"display,omitempty"`
	Internal     bool             `json:"internal,omitempty"`
	Required     bool             `json:"required,omitempty"`
	Value        interface{}      `json:"value,omitempty"`
	UserEditable bool             `json:"userEdit,omitempty"`
	Type         string           `json:"type,omitempty"`
	Options      []VariableOption `json:"options,omitempty"`
}

type VariableOption

type VariableOption struct {
	Value   interface{} `json:"value"`
	Display string      `json:"display"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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