data

package
v0.0.0-...-ba83c43 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 3 Imported by: 0

README

/app/data

Code in this directory is all about Storage/Databases.

If your service needs to access some kind of DB, place all logic related to it here.

If your service doesn't need to access any kind of DB it's better to delete this directory

Examples

  • SQL (MySQL, PostgreSQL,...)
  • Document storage (mongo, ...)
  • Key->Value storage (Redis, ...)
  • AWS S3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CarDB

type CarDB interface {
	InsertCar(ctx context.Context, car *CarEntity) error
	PaintCar(ctx context.Context, carNumber string, newColor string) error
	GetCar(ctx context.Context, carNumber string) (*CarEntity, error)
	RemoveCar(ctx context.Context, carNumber string) (*CarEntity, error)
}

This interface will represent our car db

func CreateCarDB

func CreateCarDB(deps carDBDeps) CarDB

type CarEntity

type CarEntity struct {
	CarNumber     string
	Owner         string
	BodyStyle     string
	OriginalColor string
	CurrentColor  string
	Painted       bool
}

CarEntity is our internal representation of the car

Jump to

Keyboard shortcuts

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