miniware

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: AGPL-3.0-or-later Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MINILOCK_ID_KEY      = "minilock_id"
	MINILOCK_KEYPAIR_KEY = "minilock_keypair"
	WEBSOCKET_CONNECTION = "websocket_connection"

	AuthError = "Error authorizing you"
)

Variables

View Source
var (
	ErrAuthTokenNotFound  = errors.New("Auth token not found")
	ErrMinilockIDNotFound = errors.New("miniLock ID not found")
)

Functions

func Auth

func Auth(h http.Handler, m *Mapper) func(w http.ResponseWriter, req *http.Request)

func GetMinilockID

func GetMinilockID(req *http.Request) (string, error)

func GetWebsocketConn

func GetWebsocketConn(req *http.Request) (*websocket.Conn, error)

Types

type Mapper

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

func NewMapper

func NewMapper() *Mapper

func (*Mapper) GetMinilockID

func (m *Mapper) GetMinilockID(authToken string) (string, error)

func (*Mapper) SetMinilockID

func (m *Mapper) SetMinilockID(authToken, mID string) error

Jump to

Keyboard shortcuts

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