contacts

package
v0.0.0-...-bb96ada Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

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

func (Contact) Color

func (c Contact) Color() string

func (Contact) CreatedAt

func (c Contact) CreatedAt() time.Time

func (Contact) ID

func (c Contact) ID() uuid.UUID

func (Contact) Name

func (c Contact) Name() *Name

type CreateCmd

type CreateCmd struct{}

type EditNameCmd

type EditNameCmd struct {
	Contact    *Contact
	Prefix     string
	FirstName  string
	MiddleName string
	Surname    string
	Suffix     string
}

type FakeContactBuilder

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

func NewFakeContact

func NewFakeContact(t testing.TB) *FakeContactBuilder

func (*FakeContactBuilder) Build

func (f *FakeContactBuilder) Build() *Contact

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func NewMockService

func NewMockService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockService

NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockService) Create

func (_m *MockService) Create(ctx context.Context, cmd *CreateCmd) (*Contact, error)

Create provides a mock function with given fields: ctx, cmd

func (*MockService) Delete

func (_m *MockService) Delete(ctx context.Context, contact *Contact) error

Delete provides a mock function with given fields: ctx, contact

func (*MockService) EditName

func (_m *MockService) EditName(ctx context.Context, cmd *EditNameCmd) (*Contact, error)

EditName provides a mock function with given fields: ctx, cmd

func (*MockService) GetAll

func (_m *MockService) GetAll(ctx context.Context, paginateCmd *sqlstorage.PaginateCmd) ([]Contact, error)

GetAll provides a mock function with given fields: ctx, paginateCmd

func (*MockService) GetByID

func (_m *MockService) GetByID(ctx context.Context, id uuid.UUID) (*Contact, error)

GetByID provides a mock function with given fields: ctx, id

type Name

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

func (*Name) DisplayName

func (n *Name) DisplayName() string

func (*Name) FirstName

func (n *Name) FirstName() string

func (*Name) MiddleName

func (n *Name) MiddleName() string

func (*Name) Prefix

func (n *Name) Prefix() string

func (*Name) Suffix

func (n *Name) Suffix() string

func (*Name) Surname

func (n *Name) Surname() string

type Service

type Service interface {
	Create(ctx context.Context, cmd *CreateCmd) (*Contact, error)
	GetByID(ctx context.Context, id uuid.UUID) (*Contact, error)
	EditName(ctx context.Context, cmd *EditNameCmd) (*Contact, error)
	GetAll(ctx context.Context, paginateCmd *sqlstorage.PaginateCmd) ([]Contact, error)
	Delete(ctx context.Context, contact *Contact) error
}

func Init

func Init(
	tools tools.Tools,
	db sqlstorage.Querier,
) Service

Jump to

Keyboard shortcuts

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