types

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyIDSize = 8 // public part
	TokenSize = KeyIDSize + keyDataSize
)

Variables

View Source
var ErrKeySize = errors.New("key size invalid")

Functions

This section is empty.

Types

type AccessKey

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

func NewAccessKey

func NewAccessKey(hash []byte, host, path string) (*AccessKey, error)

func (*AccessKey) Valid

func (t *AccessKey) Valid(host, path string, payload []byte) bool
type Header struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Headers

type Headers []Header

func (Headers) With

func (headers Headers) With(name, value string) Headers

func (Headers) Without

func (headers Headers) Without(name string) Headers

type Key

type Key [TokenSize]byte

func NewKey

func NewKey() (Key, error)

func ParseKey

func ParseKey(value string) (key Key, err error)

func (Key) AccessKey

func (rt Key) AccessKey(host, path string) (*AccessKey, error)

func (Key) Hash

func (rt Key) Hash() []byte

func (Key) ID

func (rt Key) ID() KeyID

func (Key) Payload

func (rt Key) Payload() []byte

func (Key) String

func (rt Key) String() string

type KeyID

type KeyID [KeyIDSize]byte

func (*KeyID) MarshalText

func (kid *KeyID) MarshalText() ([]byte, error)

func (*KeyID) Scan

func (kid *KeyID) Scan(value any) error

func (KeyID) String

func (kid KeyID) String() string

func (*KeyID) UnmarshalText

func (kid *KeyID) UnmarshalText(text []byte) error

func (KeyID) Value

func (kid KeyID) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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