domain

package
v0.0.0-...-29bb57a Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AllEnvironments a collection of all valid environments

View Source
var ErrInvalidEnvironment = fail.New("supplied environment is not supported")

ErrInvalidEnvironment for when an environment is not defined in our app

View Source
var ErrNotFound = sql.ErrNoRows

ErrNotFound for when an entity could not be found

Functions

func WrapError

func WrapError(err error, annotators ...fail.Annotator) error

WrapError wraps errors except for domain logic related ones

Types

type Environment

type Environment string

Environment of the app

const (
	EnvProduction  Environment = "production"
	EnvDevelopment Environment = "development"
	EnvTest        Environment = "test"
)

Environment enum

func (Environment) ShouldSecure

func (env Environment) ShouldSecure() bool

ShouldSecure indicates wether or not the environment needs to have security enforced

func (Environment) Validate

func (env Environment) Validate() error

Validate wether or the the environment is a valid one

type Resume

type Resume struct {
	Slug    string `json:"slug" db:"slug"`
	Body    string `json:"body" db:"body"`
	Enabled bool   `json:"enabled" db:"enabled"`
}

Resume is a container for a JSON resume blob

type ResumeLog

type ResumeLog struct {
	ID        uint64 `json:"id" db:"id"`
	Slug      string `json:"slug" db:"slug"`
	IPAddress string `json:"ip_address" db:"ip_address"`
	UserAgent string `json:"user_agent" db:"user_agent"`
}

ResumeLog is used to keep track of visits to a resume

func (ResumeLog) Validate

func (r ResumeLog) Validate() (bool, error)

Validate checks if a resume log is valid

Jump to

Keyboard shortcuts

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