registrar

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRegistrar = errors.New("webhook/api/registrar: registrar is nil")
	ErrNoAuth      = errors.New("webhook/api/registrar: no Authorization is provided")
	ErrNoUID       = errors.New("webhook/api/registrar: no uid is provided")
	ErrNoPassword  = errors.New("webhook/api/registrar: no password is provided")
	ErrVerify      = errors.New("webhook/api/registrar: verification failure")
	ErrUIDMismatch = errors.New("webhook/api/registrar: uid mismatch")
)

Functions

func BasicAuth added in v0.15.1

func BasicAuth(ctx *gin.Context) (uid, password string, err error)

func Register added in v0.15.1

func Register(ctx *gin.Context) (user any, data any, err error)

func SetRegistrar added in v0.15.1

func SetRegistrar(reg Registrar)

func SetRegistrarFunc added in v0.15.1

func SetRegistrarFunc(fn RegistrarFunc)

Types

type Registrar added in v0.15.1

type Registrar interface {
	Initial(extra map[string]any) error
	Register(ctx *gin.Context) (user any, data any, err error)
}

type RegistrarFunc added in v0.15.1

type RegistrarFunc func(ctx *gin.Context) (user any, data any, err error)

func (RegistrarFunc) Initial added in v0.15.1

func (RegistrarFunc) Initial(map[string]any) error

func (RegistrarFunc) Register added in v0.15.1

func (r RegistrarFunc) Register(ctx *gin.Context) (any, any, error)

Jump to

Keyboard shortcuts

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