security

package
v0.0.0-...-caa70b2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ROLE_ADMIN = "ROLE_ADMIN"
	ROLE_USER  = "ROLE_USER"
)

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	bun.BaseModel `bun:"table:credentials,alias:c"`

	domain.Entity
	Username string    `bun:"username,notnull,unique"`
	Password string    `bun:"password_hash,notnull"`
	UserID   uuid.UUID `bun:"user_id,notnull,unique"`
}

func NewCredentials

func NewCredentials(username, password string) *Credentials

type Role

type Role struct {
	bun.BaseModel `bun:"table:roles,alias:r"`

	domain.Entity
	Name   string    `bun:"name,notnull"`
	UserID uuid.UUID `bun:"user_id,notnull,unique"`
}

func NewRole

func NewRole(name string) *Role

type RoleOption

type RoleOption func(*Role)

func RoleName

func RoleName(name string) RoleOption

Jump to

Keyboard shortcuts

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