Documentation ¶
Index ¶
- Constants
- Variables
- func JoinValueAndSign(sign crypto.B64, value string) string
- func NewMemoryStorage() *storage
- func Open(path string) (*storage, error)
- func SplitValueAndSign(joined string) (sign crypto.B64, value string, err error)
- func TryEnableFastOpen(ln net.Listener)
- type Value
- func (v *Value) Decode() (url.Values, error)
- func (v *Value) MustSign(sk crypto.B64) *ValueWithSign
- func (v *Value) PK() crypto.B64
- func (v *Value) Sign(sk crypto.B64) (*ValueWithSign, error)
- func (v *Value) String() string
- func (v *Value) Time() time.Time
- func (v *Value) VerifySignature(sign crypto.B64) error
- type ValueWithSign
- type Verival
- func (vv *Verival) FastHttpErrorHandler(r *fasthttp.RequestCtx, err error)
- func (vv *Verival) FastHttpHandler(r *fasthttp.RequestCtx)
- func (vv *Verival) Get(pk crypto.B64) (*ValueWithSign, error)
- func (vv *Verival) Put(data string) error
- func (vv *Verival) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (vv *Verival) ServeUDP(addr net.Addr)
Constants ¶
View Source
const InMemory = ":memory:"
Variables ¶
View Source
var ErrInvalidValueCodec = errors.New("invalid value codec")
View Source
var ErrNewerValueExists = errors.New("newer value exists")
Functions ¶
func NewMemoryStorage ¶
func NewMemoryStorage() *storage
func SplitValueAndSign ¶
func TryEnableFastOpen ¶ added in v0.2.0
Types ¶
type ValueWithSign ¶
type ValueWithSign struct {
// contains filtered or unexported fields
}
func NewValueWithSign ¶
func NewValueWithSign(val *Value, sign crypto.B64) *ValueWithSign
func ParseValueWithSign ¶
func ParseValueWithSign(str string) (*ValueWithSign, error)
func (*ValueWithSign) Sign ¶
func (vs *ValueWithSign) Sign() crypto.B64
func (*ValueWithSign) String ¶
func (vs *ValueWithSign) String() string
func (*ValueWithSign) Value ¶
func (vs *ValueWithSign) Value() *Value
func (*ValueWithSign) Verify ¶
func (vs *ValueWithSign) Verify() error
type Verival ¶
type Verival struct {
// contains filtered or unexported fields
}
func NewVerival ¶
func NewVerival(st *storage) *Verival
func (*Verival) FastHttpErrorHandler ¶ added in v0.2.0
func (vv *Verival) FastHttpErrorHandler(r *fasthttp.RequestCtx, err error)
func (*Verival) FastHttpHandler ¶ added in v0.2.0
func (vv *Verival) FastHttpHandler(r *fasthttp.RequestCtx)
Click to show internal directories.
Click to hide internal directories.