webapi

package
v0.0.0-...-93e8ec0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package webapi implements working with a specific WebAPI.

Code generated by MockGen. DO NOT EDIT. Source: ./internal/webapi/interfaces.go

Generated by this command:

mockgen -source=./internal/webapi/interfaces.go -destination=./internal/webapi/webapi_mocks.go -package=webapi

Package webapi is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockWebAPI

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

MockWebAPI is a mock of WebAPI interface.

func NewMockWebAPI

func NewMockWebAPI(ctrl *gomock.Controller) *MockWebAPI

NewMockWebAPI creates a new mock instance.

func (*MockWebAPI) AddAbsenceStatus

func (m *MockWebAPI) AddAbsenceStatus(arg0 *entity.User, arg1 [2]entity.CustomTime) error

AddAbsenceStatus mocks base method.

func (*MockWebAPI) EXPECT

func (m *MockWebAPI) EXPECT() *MockWebAPIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockWebAPI) GetUserID

func (m *MockWebAPI) GetUserID(arg0 *entity.User) error

GetUserID mocks base method.

type MockWebAPIMockRecorder

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

MockWebAPIMockRecorder is the mock recorder for MockWebAPI.

func (*MockWebAPIMockRecorder) AddAbsenceStatus

func (mr *MockWebAPIMockRecorder) AddAbsenceStatus(arg0, arg1 any) *gomock.Call

AddAbsenceStatus indicates an expected call of AddAbsenceStatus.

func (*MockWebAPIMockRecorder) GetUserID

func (mr *MockWebAPIMockRecorder) GetUserID(arg0 any) *gomock.Call

GetUserID indicates an expected call of GetUserID.

type UserWebAPI

type UserWebAPI struct {
	Credentials        *entity.Credentials
	AbsencesReasonList map[int]*entity.AbsenceReason
	BasicAuthToken     string
}

UserWebAPI implements WebAPI interface. It authenticates and works with a certain WebAPI.

func NewUserWebAPI

func NewUserWebAPI(c *entity.Credentials) *UserWebAPI

NewUserWebAPI returns UserWebAPI entity and generates token for HTTP Basic Auth.

func (*UserWebAPI) AddAbsenceStatus

func (a *UserWebAPI) AddAbsenceStatus(u *entity.User, p [2]entity.CustomTime) error

AddAbsenceStatus finds user absence status info for a time period p on a specific WebAPI and adds it to the user data.

func (*UserWebAPI) GetUserID

func (a *UserWebAPI) GetUserID(u *entity.User) error

GetUserID finds the user id on a specific WebAPI.

type WebAPI

type WebAPI interface {
	GetUserID(*entity.User) error
	AddAbsenceStatus(*entity.User, [2]entity.CustomTime) error
}

WebAPI is a minimal interface for modifying user data based on a specific WebAPI.

Jump to

Keyboard shortcuts

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