core

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderDescending = 0
	OrderAscending  = 1
)

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 PaginatedList

type PaginatedList[T any] struct {
	Pagination Pagination
	Items      []T
}

type PaginatedListOrder

type PaginatedListOrder int

type Pagination

type Pagination struct {
	CurrentPage     int
	ElementsPerPage int
	TotalElements   int
	Order           PaginatedListOrder
	OrderBy         string
}

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
}

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