services

package
v0.0.0-...-eca6f23 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	// Config stores the application configuration.
	Config *config.Config

	// Validator stores the validator.
	Validator *Validator

	// Web stores the API framework.
	Web *echo.Echo

	// ItemRepo provides access to the Item storage medium.
	ItemRepo repository.ItemRepo
}

Container contains all services used by the application and provides an easy way to handle dependency injection.

func NewContainer

func NewContainer() *Container

NewContainer creates an instance of the Container struct with each of it's components initialized.

func (*Container) Shutdown

func (c *Container) Shutdown() error

Shutdown safetly shuts down all services within the container.

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator provides validation mainly by validating structs within the web context.

func NewValidator

func NewValidator() *Validator

NewValidator creates a new Validator.

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Validate validates the given interface as a struct. The struct type definition should include validation annotations.

Jump to

Keyboard shortcuts

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