Documentation
¶
Overview ¶
Package app provides business logic.
Package app is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrContactExists = errors.New("contact already exists")
)
Errors.
var (
Metric def.Metrics // Common metrics used by all packages.
)
Functions ¶
func InitMetrics ¶
func InitMetrics(reg *prometheus.Registry)
InitMetrics must be called once before using this package. It registers and initializes metrics used by this package.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App implements interface Appl.
func (*App) AddContact ¶
func (*App) HealthCheck ¶ added in v1.2.0
type Appl ¶
type Appl interface { // HealthCheck returns error if service is unhealthy or current // status otherwise. // Errors: none. HealthCheck(Ctx) (interface{}, error) // Contacts returns all contacts. // Errors: none. Contacts(Ctx, Auth, SeekPage) ([]Contact, error) // AddContact adds new contact. // Errors: ErrContactExists. AddContact(_ Ctx, _ Auth, name string) (*Contact, error) }
Appl provides application features (use cases) service.
type Config ¶ added in v1.4.0
type Config struct{}
Config contains configuration for business-logic.
type MockAppl ¶
type MockAppl struct {
// contains filtered or unexported fields
}
MockAppl is a mock of Appl interface.
func NewMockAppl ¶
func NewMockAppl(ctrl *gomock.Controller) *MockAppl
NewMockAppl creates a new mock instance.
func (*MockAppl) AddContact ¶
AddContact mocks base method.
func (*MockAppl) EXPECT ¶
func (m *MockAppl) EXPECT() *MockApplMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAppl) HealthCheck ¶ added in v1.2.0
HealthCheck mocks base method.
type MockApplMockRecorder ¶
type MockApplMockRecorder struct {
// contains filtered or unexported fields
}
MockApplMockRecorder is the mock recorder for MockAppl.
func (*MockApplMockRecorder) AddContact ¶
func (mr *MockApplMockRecorder) AddContact(arg0, arg1, name interface{}) *gomock.Call
AddContact indicates an expected call of AddContact.
func (*MockApplMockRecorder) Contacts ¶
func (mr *MockApplMockRecorder) Contacts(arg0, arg1, arg2 interface{}) *gomock.Call
Contacts indicates an expected call of Contacts.
func (*MockApplMockRecorder) HealthCheck ¶ added in v1.2.0
func (mr *MockApplMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call
HealthCheck indicates an expected call of HealthCheck.
type MockRepo ¶
type MockRepo struct {
// contains filtered or unexported fields
}
MockRepo is a mock of Repo interface.
func NewMockRepo ¶
func NewMockRepo(ctrl *gomock.Controller) *MockRepo
NewMockRepo creates a new mock instance.
func (*MockRepo) AddContact ¶
AddContact mocks base method.
func (*MockRepo) EXPECT ¶
func (m *MockRepo) EXPECT() *MockRepoMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockRepoMockRecorder ¶
type MockRepoMockRecorder struct {
// contains filtered or unexported fields
}
MockRepoMockRecorder is the mock recorder for MockRepo.
func (*MockRepoMockRecorder) AddContact ¶
func (mr *MockRepoMockRecorder) AddContact(arg0, name interface{}) *gomock.Call
AddContact indicates an expected call of AddContact.
func (*MockRepoMockRecorder) LstContacts ¶ added in v1.3.0
func (mr *MockRepoMockRecorder) LstContacts(arg0, arg1 interface{}) *gomock.Call
LstContacts indicates an expected call of LstContacts.
type Repo ¶
type Repo interface { // LstContacts returns up to limit contacts with ID > sinceID, // ordered by ID. // Errors: none. LstContacts(Ctx, SeekPage) ([]Contact, error) // AddContact adds new contact and returns it ID. // Errors: ErrContactExists. AddContact(_ Ctx, name string) (id int, err error) }
Repo provides data storage.