coin

package
v0.0.0-...-fd0e660 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RiskMinor = iota + 1
	RiskModerate
	RiskHight
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Coin

type Coin struct {
	Id    int    `json:"id"`
	Name  string `json:"name"`
	Value int32  `json:"value"`
	Risk  Risk   `json:"risk"`
}

type Risk

type Risk int

func (Risk) String

func (risk Risk) String() string

type Service

type Service struct {
	DB *sql.DB
}

func NewService

func NewService(db *sql.DB) *Service

func (*Service) Get

func (s *Service) Get(ID int) (*Coin, error)

func (*Service) GetAll

func (s *Service) GetAll() ([]*Coin, error)

func (*Service) Store

func (s *Service) Store(c *Coin) error

type UseCase

type UseCase interface {
	GetAll() ([]*Coin, error)
	Get(ID int) (*Coin, error)
	Store(c *Coin) error
}

Jump to

Keyboard shortcuts

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