api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func New

func New(address string, repo WineRepository) *Server

func (*Server) AddWine

func (s *Server) AddWine(c *gin.Context)

func (*Server) GetWine

func (s *Server) GetWine(c *gin.Context)

func (*Server) ListWine

func (s *Server) ListWine(c *gin.Context)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type WineRepository

type WineRepository interface {
	GetWineList(ctx context.Context) (map[string]model.Wine, error)
	GetWine(ctx context.Context, id string) (*model.Wine, error)
	AddWine(ctx context.Context, id string, w model.Wine) error
}

Jump to

Keyboard shortcuts

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