core

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Authorize(next http.HandlerFunc) http.HandlerFunc
	Admin(next http.HandlerFunc) http.HandlerFunc
	AuthorizeRoles(roles []Role, next http.HandlerFunc) http.HandlerFunc
}

type Cypher

type Cypher interface {
	Encrypt(data []byte) ([]byte, error)
	UnEncrypt(data []byte) ([]byte, error)
}

type Hasher

type Hasher interface {
	Hash(value string) string
	Check(a, b string) bool
}

type Role

type Role int
const (
	RoleAdmin Role = iota
	RoleUser
)

type UseCase

type UseCase[R any, T any] func(R) (T, error)

UseCase is anything that have application domain code.

type UseCaseError

type UseCaseError struct {
	Code   uint16
	Reason string
}

func (UseCaseError) Error added in v0.0.9

func (caseErr UseCaseError) Error() string

type Validator

type Validator func(interface{}) map[string]string

Jump to

Keyboard shortcuts

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