types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential added in v0.3.3

type Credential struct {
	User  int
	Group int
}

func (*Credential) Equal added in v0.3.3

func (cr *Credential) Equal(other *Credential) bool

type File added in v0.3.3

type File struct {
	Name string `json:"name"`
	Dir  bool   `json:"is_dir"`
}

type JsonDuration

type JsonDuration time.Duration

func (*JsonDuration) MarshalJSON

func (j *JsonDuration) MarshalJSON() ([]byte, error)

func (*JsonDuration) UnmarshalJSON

func (j *JsonDuration) UnmarshalJSON(bytes []byte) error

type JsonStringSet

type JsonStringSet map[string]bool

func StringSet added in v0.3.5

func StringSet(values ...string) JsonStringSet

func (*JsonStringSet) Del

func (s *JsonStringSet) Del(key string)

func (*JsonStringSet) Dup added in v0.3.3

func (s *JsonStringSet) Dup() JsonStringSet

func (*JsonStringSet) Has

func (s *JsonStringSet) Has(key string) bool

func (*JsonStringSet) MarshalJSON

func (s *JsonStringSet) MarshalJSON() ([]byte, error)

func (*JsonStringSet) Set

func (s *JsonStringSet) Set(key string)

func (*JsonStringSet) UnmarshalJSON

func (s *JsonStringSet) UnmarshalJSON(bytes []byte) error

type Manifest

type Manifest struct {
	Name           string            `json:"name,omitempty"`            // information field
	Description    string            `json:"description,omitempty"`     // information field
	Run            []string          `json:"run"`                       // command to run
	OutputHeaders  map[string]string `json:"output_headers,omitempty"`  // output headers
	InputHeaders   map[string]string `json:"input_headers,omitempty"`   // headers to map from request to environment
	Query          map[string]string `json:"query,omitempty"`           // map query or form parameters to environment
	Environment    map[string]string `json:"environment,omitempty"`     // custom environment
	Method         string            `json:"method,omitempty"`          // restrict invoke only to the HTTP method
	MethodEnv      string            `json:"method_env,omitempty"`      // map method name to environment
	PathEnv        string            `json:"path_env,omitempty"`        // map requested path to environment
	TimeLimit      JsonDuration      `json:"time_limit,omitempty"`      // time limit to run (zero is infinity)
	MaximumPayload int64             `json:"maximum_payload,omitempty"` // limit incoming payload (zero is unlimited)
	Cron           []Schedule        `json:"cron,omitempty"`            // crontab expression and action name to invoke
	Static         string            `json:"static,omitempty"`          // relative path to static folder
}

func (*Manifest) LoadFrom

func (mf *Manifest) LoadFrom(filename string) error

func (*Manifest) SaveAs

func (mf *Manifest) SaveAs(filename string) error

func (*Manifest) Validate added in v0.2.5

func (mf *Manifest) Validate() error

type Request added in v0.3.3

type Request struct {
	Method        string            `json:"method" msg:"method"`
	URL           string            `json:"url" msg:"url"`
	Path          string            `json:"path" msg:"path"`
	RemoteAddress string            `json:"remote_address" msg:"remote_address"`
	Form          map[string]string `json:"form" msg:"form"`
	Headers       map[string]string `json:"headers" msg:"headers"`
	Body          io.ReadCloser     `json:"-" msg:"-"`
}

func FromHTTP added in v0.3.3

func FromHTTP(r *http.Request, behindProxy bool) *Request

Create request from HTTP request

func (*Request) DecodeMsg added in v0.3.3

func (z *Request) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Request) EncodeMsg added in v0.3.3

func (z *Request) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Request) MarshalMsg added in v0.3.3

func (z *Request) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Request) Msgsize added in v0.3.3

func (z *Request) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Request) UnmarshalMsg added in v0.3.3

func (z *Request) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Request) WithBody added in v0.3.5

func (z *Request) WithBody(reader io.ReadCloser) *Request

Returns shallow copy of request with new body

type Schedule added in v0.2.5

type Schedule struct {
	Cron      string       `json:"cron"`       // crontab expression
	Action    string       `json:"action"`     // action to invoke
	TimeLimit JsonDuration `json:"time_limit"` // time limit to execute
}

Jump to

Keyboard shortcuts

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