Documentation
¶
Index ¶
- Variables
- func AcquireCookieBuffer() *buffer.SliceBuffer
- func NewZeroHasher(h hash.Hash) hash.Hash
- func ReleaseCookieBuffer(b *buffer.SliceBuffer)
- func ReleaseValidatorRequest(v *ValidatorRequest)
- func ReleaseValidatorResponse(v *ValidatorResponse)
- type Berghain
- type LevelConfig
- type RequestIdentifier
- type ValidationType
- type ValidatorRequest
- type ValidatorResponse
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AcquireCookieBuffer ¶
func AcquireCookieBuffer() *buffer.SliceBuffer
func ReleaseCookieBuffer ¶
func ReleaseCookieBuffer(b *buffer.SliceBuffer)
func ReleaseValidatorRequest ¶
func ReleaseValidatorRequest(v *ValidatorRequest)
func ReleaseValidatorResponse ¶
func ReleaseValidatorResponse(v *ValidatorResponse)
Types ¶
type Berghain ¶
type Berghain struct {
Levels []*LevelConfig
TrustedDomains []string
// contains filtered or unexported fields
}
func NewBerghain ¶
func (*Berghain) IsValidCookie ¶
func (b *Berghain) IsValidCookie(ri RequestIdentifier, cookie []byte) error
func (*Berghain) LevelConfig ¶
func (b *Berghain) LevelConfig(level uint8) *LevelConfig
type LevelConfig ¶
type LevelConfig struct {
Countdown int
Duration time.Duration
Type ValidationType
}
type RequestIdentifier ¶
func (RequestIdentifier) ToCookie ¶
func (ri RequestIdentifier) ToCookie(b *Berghain, enc *buffer.SliceBuffer) error
type ValidationType ¶
type ValidationType int
const ( ValidationTypeNone ValidationType ValidationTypePOW )
func (ValidationType) RunValidator ¶
func (v ValidationType) RunValidator(b *Berghain, req *ValidatorRequest, resp *ValidatorResponse) error
type ValidatorRequest ¶
type ValidatorRequest struct {
Method string
Body []byte
Identifier *RequestIdentifier
}
func AcquireValidatorRequest ¶
func AcquireValidatorRequest() *ValidatorRequest
type ValidatorResponse ¶
type ValidatorResponse struct {
Body *buffer.SliceBuffer
Token *buffer.SliceBuffer
}
func AcquireValidatorResponse ¶
func AcquireValidatorResponse() *ValidatorResponse
Source Files
¶
Click to show internal directories.
Click to hide internal directories.