stuff

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 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) ReportChallengeView

func (repo *ArrayChallengeRepository) ReportChallengeView(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

	HasViewCountLimit bool
	MaxViewCount      int
	ViewCount         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) HitMaxViewCount

func (challenge *Challenge) HitMaxViewCount() bool

func (*Challenge) SetExpirationDate

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

func (*Challenge) SetMaxViewCount

func (challenge *Challenge) SetMaxViewCount(maxViewCount 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) Views

func (challenge *Challenge) Views() []*ChallengeView

type ChallengeRepository

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

func NewArrayChallengeRepository

func NewArrayChallengeRepository() ChallengeRepository

type ChallengeView

type ChallengeView struct {
	Time time.Time
	IP   string
}

Jump to

Keyboard shortcuts

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