stuff

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayChallengeRepository

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

func (*ArrayChallengeRepository) All

func (repo *ArrayChallengeRepository) All(limit int, offset int) []*Challenge

func (*ArrayChallengeRepository) Get

func (repo *ArrayChallengeRepository) Get(ID string) *Challenge

func (*ArrayChallengeRepository) Remove

func (repo *ArrayChallengeRepository) Remove(challenge *Challenge)

func (*ArrayChallengeRepository) ReportChallengeUpload added in v0.0.2

func (repo *ArrayChallengeRepository) ReportChallengeUpload(challenge *Challenge, filePath string, request *http.Request)

func (*ArrayChallengeRepository) Set

func (repo *ArrayChallengeRepository) Set(challenge *Challenge)

type Challenge

type Challenge struct {
	ID         string
	Public     bool
	SharedPath string

	HasPassword  bool
	PasswordHash string

	Expires    bool
	ValidUntil time.Time

	HasUploadCountLimit bool
	MaxUploadCount      int
	UploadCount         int
	// contains filtered or unexported fields
}

func (*Challenge) Accessible

func (challenge *Challenge) Accessible(r *http.Request) bool

func (*Challenge) CheckPassword

func (challenge *Challenge) CheckPassword(password string) error

func (*Challenge) CookieName

func (challenge *Challenge) CookieName() string

func (*Challenge) Expired

func (challenge *Challenge) Expired() bool

func (*Challenge) HitMaxUploadCount added in v0.0.2

func (challenge *Challenge) HitMaxUploadCount() bool

func (*Challenge) SetExpirationDate

func (challenge *Challenge) SetExpirationDate(date time.Time)

func (*Challenge) SetMaxUploadCount added in v0.0.2

func (challenge *Challenge) SetMaxUploadCount(maxUploadCount int)

func (*Challenge) SetPassword

func (challenge *Challenge) SetPassword(password string) error

func (*Challenge) StorePassword

func (challenge *Challenge) StorePassword(password string, w http.ResponseWriter, r *http.Request)

func (*Challenge) Uploads added in v0.0.2

func (challenge *Challenge) Uploads() []*ChallengeUpload

type ChallengeRepository

type ChallengeRepository interface {
	All(limit int, offset int) []*Challenge
	Get(ID string) *Challenge
	Set(challenge *Challenge)
	Remove(challenge *Challenge)
	ReportChallengeUpload(challenge *Challenge, filePath string, request *http.Request)
}

func NewArrayChallengeRepository

func NewArrayChallengeRepository() ChallengeRepository

type ChallengeUpload added in v0.0.2

type ChallengeUpload struct {
	Time time.Time
	IP   string
}

Jump to

Keyboard shortcuts

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