Documentation ¶
Overview ¶
Package domain is a generated GoMock package.
Package domain is a generated GoMock package.
Package domain is a generated GoMock package.
Index ¶
- Variables
- type ActiveBucketsStore
- type Bucket
- type Bucketer
- type ManageController
- type Manager
- type MockBucketer
- type MockBucketerMockRecorder
- type MockManageController
- func (m *MockManageController) Dispatch(login, pwd, ip string) (bool, error)
- func (m *MockManageController) EXPECT() *MockManageControllerMockRecorder
- func (m *MockManageController) FlushBuckets(login, ip string) error
- func (m *MockManageController) GetErrChan() chan error
- func (m *MockManageController) PurgeBucket(name string) error
- type MockManageControllerMockRecorder
- func (mr *MockManageControllerMockRecorder) Dispatch(login, pwd, ip interface{}) *gomock.Call
- func (mr *MockManageControllerMockRecorder) FlushBuckets(login, ip interface{}) *gomock.Call
- func (mr *MockManageControllerMockRecorder) GetErrChan() *gomock.Call
- func (mr *MockManageControllerMockRecorder) PurgeBucket(name interface{}) *gomock.Call
- type MockStorer
- type MockStorerMockRecorder
- func (mr *MockStorerMockRecorder) AddBucket(name, b interface{}) *gomock.Call
- func (mr *MockStorerMockRecorder) CheckBucket(name interface{}) *gomock.Call
- func (mr *MockStorerMockRecorder) GetBucket(name interface{}) *gomock.Call
- func (mr *MockStorerMockRecorder) RemoveBucket(name interface{}) *gomock.Call
- type Settings
- type Storer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBucketFull reports faulty attempts to dispatch buckets ErrBucketFull = errors.New("some of the buckets returned false") // ErrEmptyBucketName missing bucket name error ErrEmptyBucketName = errors.New("empty bucket name received") // ErrNoBucketFound missing bucket error ErrNoBucketFound = errors.New("no bucket found in store") )
var ( // ErrEmptyIP reports empty id errors ErrEmptyIP = errors.New("empty IP is received") // ErrEmptyLogin reports empty login errors ErrEmptyLogin = errors.New("empty login is received") // ErrEmptyPWD reports empty password errors ErrEmptyPWD = errors.New("empty password is received") )
var ErrDeleteMissingBucket = errors.New("no bucket found in store for deletion")
ErrDeleteMissingBucket reports an attempt to delete not-existing buckets
Functions ¶
This section is empty.
Types ¶
type ActiveBucketsStore ¶
type ActiveBucketsStore struct {
// contains filtered or unexported fields
}
ActiveBucketsStore is an object that provides a storage for all buckets.
func NewActiveBucketsStore ¶
func NewActiveBucketsStore() *ActiveBucketsStore
NewActiveBucketsStore returns a new ActiveBucketsStore object to the callee
func (*ActiveBucketsStore) AddBucket ¶
func (abs *ActiveBucketsStore) AddBucket(name string, b Bucketer)
AddBucket adds a new bucket to the active bucket store
func (*ActiveBucketsStore) CheckBucket ¶
func (abs *ActiveBucketsStore) CheckBucket(name string) bool
CheckBucket checks whether a requested bucket is present in the active bucket store
func (*ActiveBucketsStore) GetBucket ¶
func (abs *ActiveBucketsStore) GetBucket(name string) (Bucketer, error)
GetBucket returns the requested bucket to the callee
func (*ActiveBucketsStore) RemoveBucket ¶
func (abs *ActiveBucketsStore) RemoveBucket(name string) error
RemoveBucket removes a specified bucket from the active bucket store
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket is a structure that represents a bucket object
func (*Bucket) Decrement ¶
Decrement reduces the bucket request counter; it return true if the request can pass and false otherwise
type Bucketer ¶
type Bucketer interface { // Decrement reduces the bucket request counter; it return true if the request can pass and false otherwise Decrement() bool // GetCount returns the current count value of the bucket GetCount() int // Stop releases all the resources associated with the bucket Stop() }
Bucketer allows for the communication with any created bucket
type ManageController ¶
type ManageController interface { // Dispatch accepts authorisation request parameters and creates a new or decrements a counter for each bucket Dispatch(login string, pwd string, ip string) (bool, error) // FlushBuckets removes all buckets with the specified login and ip FlushBuckets(login string, ip string) error // PurgeBucket removes a bucket which name was specified as an argument PurgeBucket(name string) error // GetErrChan returns an error channel to monitor the Manager's activity GetErrChan() chan error }
ManageController is a representation of a Bucket Manager interface
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an object that controls all the functionality to manage buckets
func NewManager ¶
NewManager creates a new Manager object and returns it to the callee
func (*Manager) Dispatch ¶
Dispatch accepts authorisation request parameters and creates a new or decrements a counter for each bucket
func (*Manager) FlushBuckets ¶
FlushBuckets removes all buckets with the specified login and ip
func (*Manager) GetErrChan ¶
GetErrChan returns an error channel to monitor the Manager's activity
func (*Manager) PurgeBucket ¶
PurgeBucket removes a bucket which name was specified as an argument
type MockBucketer ¶
type MockBucketer struct {
// contains filtered or unexported fields
}
MockBucketer is a mock of Bucketer interface
func NewMockBucketer ¶
func NewMockBucketer(ctrl *gomock.Controller) *MockBucketer
NewMockBucketer creates a new mock instance
func (*MockBucketer) Decrement ¶
func (m *MockBucketer) Decrement() bool
Decrement mocks base method
func (*MockBucketer) EXPECT ¶
func (m *MockBucketer) EXPECT() *MockBucketerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockBucketerMockRecorder ¶
type MockBucketerMockRecorder struct {
// contains filtered or unexported fields
}
MockBucketerMockRecorder is the mock recorder for MockBucketer
func (*MockBucketerMockRecorder) Decrement ¶
func (mr *MockBucketerMockRecorder) Decrement() *gomock.Call
Decrement indicates an expected call of Decrement
func (*MockBucketerMockRecorder) GetCount ¶
func (mr *MockBucketerMockRecorder) GetCount() *gomock.Call
GetCount indicates an expected call of GetCount
func (*MockBucketerMockRecorder) Stop ¶
func (mr *MockBucketerMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop
type MockManageController ¶
type MockManageController struct {
// contains filtered or unexported fields
}
MockManageController is a mock of ManageController interface
func NewMockManageController ¶
func NewMockManageController(ctrl *gomock.Controller) *MockManageController
NewMockManageController creates a new mock instance
func (*MockManageController) Dispatch ¶
func (m *MockManageController) Dispatch(login, pwd, ip string) (bool, error)
Dispatch mocks base method
func (*MockManageController) EXPECT ¶
func (m *MockManageController) EXPECT() *MockManageControllerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockManageController) FlushBuckets ¶
func (m *MockManageController) FlushBuckets(login, ip string) error
FlushBuckets mocks base method
func (*MockManageController) GetErrChan ¶
func (m *MockManageController) GetErrChan() chan error
GetErrChan mocks base method
func (*MockManageController) PurgeBucket ¶
func (m *MockManageController) PurgeBucket(name string) error
PurgeBucket mocks base method
type MockManageControllerMockRecorder ¶
type MockManageControllerMockRecorder struct {
// contains filtered or unexported fields
}
MockManageControllerMockRecorder is the mock recorder for MockManageController
func (*MockManageControllerMockRecorder) Dispatch ¶
func (mr *MockManageControllerMockRecorder) Dispatch(login, pwd, ip interface{}) *gomock.Call
Dispatch indicates an expected call of Dispatch
func (*MockManageControllerMockRecorder) FlushBuckets ¶
func (mr *MockManageControllerMockRecorder) FlushBuckets(login, ip interface{}) *gomock.Call
FlushBuckets indicates an expected call of FlushBuckets
func (*MockManageControllerMockRecorder) GetErrChan ¶
func (mr *MockManageControllerMockRecorder) GetErrChan() *gomock.Call
GetErrChan indicates an expected call of GetErrChan
func (*MockManageControllerMockRecorder) PurgeBucket ¶
func (mr *MockManageControllerMockRecorder) PurgeBucket(name interface{}) *gomock.Call
PurgeBucket indicates an expected call of PurgeBucket
type MockStorer ¶
type MockStorer struct {
// contains filtered or unexported fields
}
MockStorer is a mock of Storer interface
func NewMockStorer ¶
func NewMockStorer(ctrl *gomock.Controller) *MockStorer
NewMockStorer creates a new mock instance
func (*MockStorer) AddBucket ¶
func (m *MockStorer) AddBucket(name string, b Bucketer)
AddBucket mocks base method
func (*MockStorer) CheckBucket ¶
func (m *MockStorer) CheckBucket(name string) bool
CheckBucket mocks base method
func (*MockStorer) EXPECT ¶
func (m *MockStorer) EXPECT() *MockStorerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockStorer) GetBucket ¶
func (m *MockStorer) GetBucket(name string) (Bucketer, error)
GetBucket mocks base method
func (*MockStorer) RemoveBucket ¶
func (m *MockStorer) RemoveBucket(name string) error
RemoveBucket mocks base method
type MockStorerMockRecorder ¶
type MockStorerMockRecorder struct {
// contains filtered or unexported fields
}
MockStorerMockRecorder is the mock recorder for MockStorer
func (*MockStorerMockRecorder) AddBucket ¶
func (mr *MockStorerMockRecorder) AddBucket(name, b interface{}) *gomock.Call
AddBucket indicates an expected call of AddBucket
func (*MockStorerMockRecorder) CheckBucket ¶
func (mr *MockStorerMockRecorder) CheckBucket(name interface{}) *gomock.Call
CheckBucket indicates an expected call of CheckBucket
func (*MockStorerMockRecorder) GetBucket ¶
func (mr *MockStorerMockRecorder) GetBucket(name interface{}) *gomock.Call
GetBucket indicates an expected call of GetBucket
func (*MockStorerMockRecorder) RemoveBucket ¶
func (mr *MockStorerMockRecorder) RemoveBucket(name interface{}) *gomock.Call
RemoveBucket indicates an expected call of RemoveBucket
type Settings ¶
Settings is an object that holds all the main settings for the Bucket Manager
func InitBucketManagerSettings ¶
InitBucketManagerSettings initiates setting for the bucket manager
type Storer ¶
type Storer interface { // GetBucket returns the requested bucket to the callee GetBucket(name string) (Bucketer, error) // CheckBucket checks whether a requested bucket is present in the active bucket store CheckBucket(name string) bool // AddBucket adds a new bucket to the active bucket store AddBucket(name string, b Bucketer) // RemoveBucket removes a specified bucket from the active bucket store RemoveBucket(name string) error }
Storer provides a functionality to communicate with any bucket store that satisfies the interface