Documentation
¶
Index ¶
- type ArrayChallengeRepository
- func (repo *ArrayChallengeRepository) All(limit int, offset int) []*Challenge
- func (repo *ArrayChallengeRepository) Get(ID string) *Challenge
- func (repo *ArrayChallengeRepository) Remove(challenge *Challenge)
- func (repo *ArrayChallengeRepository) ReportChallengeView(challenge *Challenge, filePath string, request *http.Request)
- func (repo *ArrayChallengeRepository) Set(challenge *Challenge)
- type Challenge
- func (challenge *Challenge) Accessible(r *http.Request) bool
- func (challenge *Challenge) CheckPassword(password string) error
- func (challenge *Challenge) CookieName() string
- func (challenge *Challenge) Expired() bool
- func (challenge *Challenge) HitMaxViewCount() bool
- func (challenge *Challenge) SetExpirationDate(date time.Time)
- func (challenge *Challenge) SetMaxViewCount(maxViewCount int)
- func (challenge *Challenge) SetPassword(password string) error
- func (challenge *Challenge) StorePassword(password string, w http.ResponseWriter, r *http.Request)
- func (challenge *Challenge) Views() []*ChallengeView
- type ChallengeRepository
- type ChallengeView
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
HasPassword bool
PasswordHash string
Expires bool
ValidUntil time.Time
HasViewCountLimit bool
MaxViewCount int
ViewCount int
// contains filtered or unexported fields
}
func (*Challenge) CheckPassword ¶
func (*Challenge) CookieName ¶
func (*Challenge) HitMaxViewCount ¶
func (*Challenge) SetExpirationDate ¶
func (*Challenge) SetMaxViewCount ¶
func (*Challenge) SetPassword ¶
func (*Challenge) StorePassword ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.