Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expiration ¶
type Http ¶
type Http struct {
ServerUrl string `json:"url" default:"http://localhost:3000"`
Bind string `json:"bind" default:"127.0.0.1:3000"`
MaxContentLength bytesize.ByteSize `json:"max_content_length" default:"10MB"`
Timeout util.Duration `json:"timeout" default:"30s"`
Auth struct {
WriteTokens []string `json:"write_tokens"`
DeleteTokens []string `json:"delete_tokens"`
} `json:"auth"`
}
type LandingPage ¶
type LandingPage struct {
// listed in order of priority if set
// note that all arguments support `go templates`
File string `json:"file" `
Text string `json:"text" `
Preset string `json:"preset" default:"default"`
Parameters map[string]any `json:"parameters"`
ContentType string `json:"content_type" default:"text/plain; charset=utf-8"`
}
type MimeOverride ¶
type Paste ¶
type Paste struct {
RandomUrl RandomUrl `json:"random_url" `
HandleSpaces string `json:"handle_spaces" default:"replace"`
DefaultExt string `json:"default_extension" default:"txt"`
Expiration Expiration `json:"expiration"`
MimeOverride []MimeOverride `json:"mime_override"`
MimeBlacklist []string `json:"mime_blacklist"`
}
type RandomUrl ¶
type RandomUrl struct {
Type string `default:"sqid" json:"type"` // types xid,alphanumeric,petname
SuffixMode bool `json:"suffix_mode" default:"false"`
Length int `default:"8" json:"length"` // for alphanumeric
Words int `default:"2" json:"words"` // for petname
Separator string `default:"-" json:"separator"` // for petname
}
type Regexp ¶
Regexp adds unmarshalling from json for regexp.Regexp
func (*Regexp) MarshalText ¶
MarshalText marshals regexp.Regexp as string
func (*Regexp) UnmarshalJSON ¶
func (*Regexp) UnmarshalText ¶
UnmarshalText unmarshals json into a regexp.Regexp
Click to show internal directories.
Click to hide internal directories.