client

package
v0.0.0-...-c5ed977 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 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

This section is empty.

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(db *sql.DB) (*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) FindByIdentifier

func (s *Store) FindByIdentifier(ctx context.Context, identifier string) (*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
}

Jump to

Keyboard shortcuts

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