Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Http Http `yaml:"http" env-default:""` Paste Paste `yaml:"paste" env-default:""` LandingPage LandingPage `yaml:"landing_page" env-default:""` Endpoints Endpoints `yaml:"endpoints" env-default:""` Storage Storage `yaml:"storage" env-default:""` }
type Expiration ¶
type Http ¶
type Http struct { ServerUrl string `yaml:"url" env-default:"http://localhost:3000"` Bind string `yaml:"bind" env-default:"127.0.0.1:3000"` MaxContentLength bytesize.ByteSize `yaml:"max_content_length" env-default:"10MB"` Timeout time.Duration `yaml:"timeout" env-default:"30s"` Auth struct { WriteTokens []string `yaml:"write_tokens"` DeleteTokens []string `yaml:"delete_tokens"` } `yaml:"auth"` }
type LandingPage ¶
type LandingPage struct { // listed in order of priority if set // note that all arguments support `go templates` File string `yaml:"file" env-default:""` Text string `yaml:"text" env-default:""` Preset string `yaml:"preset" env-default:"default"` Parameters map[string]any `yaml:"parameters"` ContentType string `yaml:"content_type" env-default:"text/plain; charset=utf-8"` }
type MimeOverride ¶
type Paste ¶
type Paste struct { RandomUrl RandomUrl `yaml:"random_url" env-default:""` HandleSpaces string `yaml:"handle_spaces" env-default:"replace"` DefaultExt string `yaml:"default_ext" env-default:".txt"` Expiration Expiration `yaml:"expiration" env-default:""` MimeOverride []MimeOverride `yaml:"mime_override"` MimeBlacklist []string `yaml:"mime_blacklist"` }
type RandomUrl ¶
type RandomUrl struct { Type string `env-default:"sqid" yaml:"type"` // types xid,alphanumeric,petname SuffixMode bool `yaml:"suffix_mode" default:"false"` Length int `env-default:"8" yaml:"length"` // for alphanumeric Words int `env-default:"2" yaml:"words"` // for petname Separator string `env-default:"-" yaml:"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.