client

package module
v0.0.0-...-1020a2c Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: GPL-2.0, GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrMissingId      = "missing id argument"
	ErrClientNotFound = "could not find client with id `%d'"
)

Variables

View Source
var (
	ErrMissingConnectionUri = errors.New("store connection string must be provided")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	proto.UnimplementedClientServiceServer
	// contains filtered or unexported fields
}

func NewService

func NewService(store Storer) *Service

func (*Service) Create

func (*Service) DeleteById

func (*Service) FindById

func (*Service) FindMany

type Store

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

func NewStore

func NewStore(uri string) (*Store, error)

func (*Store) Create

func (s *Store) Create(ctx context.Context, accountId int64, input *proto.InputClient) (int64, error)

func (*Store) DeleteById

func (s *Store) DeleteById(ctx context.Context, accountId, id int64) error

func (*Store) FindById

func (s *Store) FindById(ctx context.Context, accountId, id int64) (*proto.Client, error)

func (*Store) FindMany

func (s *Store) FindMany(ctx context.Context, accountId int64) ([]*proto.Client, error)

type Storer

type Storer interface {
	Create(ctx context.Context, accountId int64, input *proto.InputClient) (int64, error)
	FindMany(ctx context.Context, accountId int64) ([]*proto.Client, error)
	FindById(ctx context.Context, accountId, id int64) (*proto.Client, error)
	DeleteById(ctx context.Context, accountId, id int64) error
}

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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