Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultTLS = false DefaultCert = "cert.pem" DefaultKey = "key.pem" DefaultAddress = "0.0.0.0" DefaultPort = 6065 DefaultPrefix = "/" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Permissions ¶
func (Permissions) Allowed ¶
func (p Permissions) Allowed(r *request, fileExists func(string) bool) bool
Allowed returns whether this permission set has permissions to execute this request in the source directory. This applies to all requests with all methods.
func (Permissions) AllowedDestination ¶ added in v5.2.0
func (p Permissions) AllowedDestination(r *request, fileExists func(string) bool) bool
AllowedDestination returns whether this permissions set has permissions to execute this request in the destination directory. This only applies for COPY and MOVE requests.
func (*Permissions) UnmarshalText ¶
func (p *Permissions) UnmarshalText(data []byte) error
type Rule ¶
type Rule struct { Permissions Permissions Path string Regex *regexp.Regexp }
type RulesBehavior ¶ added in v5.5.0
type RulesBehavior string
const ( RulesOverwrite RulesBehavior = "overwrite" RulesAppend RulesBehavior = "append" )
type User ¶
type User struct { UserPermissions `mapstructure:",squash"` Username string Password string }
type UserPermissions ¶
type UserPermissions struct { Directory string Permissions Permissions Rules []*Rule RulesBehavior RulesBehavior }
func (UserPermissions) Allowed ¶
func (p UserPermissions) Allowed(r *request, fileExists func(string) bool) bool
Allowed checks if the user has permission to access a directory/file
func (*UserPermissions) Validate ¶
func (p *UserPermissions) Validate() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.