app

package
v0.0.0-...-f99b776 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorLocomotiveNotFound = errors.New("locomotive not found")
	ErrorInvalidLocomotive  = errors.New("locomotive is invalid")
	ErrorInternalServer     = errors.New("internal server error")
)

Functions

This section is empty.

Types

type Locomotive

type Locomotive struct {
	LocoID      string `json:"loco_id" dynamodbav:"loco_id"`
	LocoName    string `json:"loco_name" dynamodbav:"loco_name"`
	ImageURL    string `json:"image_url" dynamodbav:"image_url" validate:"empty=false & format=url"`
	Description string `json:"description" dynamodbav:"description"`
	CreatedAT   int64  `json:"created_at" dynamodbav:"created_at"`
}

func (Locomotive) GetKey

func (loco Locomotive) GetKey() map[string]types.AttributeValue

type LocomotiveRepository

type LocomotiveRepository interface {
	CreateLoco(loco *Locomotive) (*Locomotive, error)
	GetLoco(loco_id string) (*Locomotive, error)
	UpdateLoco(loco *Locomotive) (*Locomotive, error)
	DeleteLoco(loco_id string) error
	GetAllLoco() (*[]Locomotive, error)
}

type LocomotiveSerializer

type LocomotiveSerializer interface {
	Decode(input []byte) (*Locomotive, error)
	Encode(input *Locomotive) ([]byte, error)
}

type LocomotiveService

type LocomotiveService interface {
	CreateLoco(loco *Locomotive) (*Locomotive, error)
	GetLoco(loco_id string) (*Locomotive, error)
	UpdateLoco(loco *Locomotive) (*Locomotive, error)
	DeleteLoco(loco_id string) error
	GetAllLoco() (*[]Locomotive, error)
}

func NewLocomotiveService

func NewLocomotiveService(locoRepo LocomotiveRepository) LocomotiveService

Jump to

Keyboard shortcuts

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