dto

package
v0.0.0-...-9d4acdc Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Code             int      `json:"code"`
	Message          string   `json:"message"`
	ValidationErrors []string `json:"validation_errors,omitempty"`
}

func NewApiError

func NewApiError(code int) *ApiError

func (*ApiError) Error

func (e *ApiError) Error() string

func (*ApiError) WithMessage

func (e *ApiError) WithMessage(message string) *ApiError

func (*ApiError) WithValidationErrors

func (e *ApiError) WithValidationErrors(validationErrors []string) *ApiError

type CustomValidator

type CustomValidator struct {
	Validator *validator.Validate
}

func NewCustomValidator

func NewCustomValidator() *CustomValidator

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

type PasscodeFinishRequest

type PasscodeFinishRequest struct {
	Id   string `json:"id" validate:"required,uuid4"`
	Code string `json:"code" validate:"required"`
}

type PasscodeInitRequest

type PasscodeInitRequest struct {
	UserId string `json:"user_id" validate:"required"`
}

type PasscodeReturn

type PasscodeReturn struct {
	Id        string    `json:"id"`
	TTL       int       `json:"ttl"`
	CreatedAt time.Time `json:"created_at"`
}

type PublicConfig

type PublicConfig struct {
	Password config.Password `json:"password"`
}

PublicConfig is the part of the configuration that will be shared with the frontend

func FromConfig

func FromConfig(config config.Config) PublicConfig

FromConfig Returns a PublicConfig from the Application configuration

type ValidationErrors

type ValidationErrors struct {
	Errors []string `json:"errors"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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