database

package
v0.0.0-...-1305305 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LOGGER = logging.MustGetLogger("database")

Functions

This section is empty.

Types

type DbClient

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

func (*DbClient) AddWhitelistParticipant

func (dc *DbClient) AddWhitelistParticipant(participant, wlparticipant string) error

func (*DbClient) CreateConnection

func (dc *DbClient) CreateConnection() error

func (*DbClient) DeleteWhitelistParticipant

func (dc *DbClient) DeleteWhitelistParticipant(participantID, wlParticipant string) error

func (*DbClient) GetWhiteListParicipants

func (dc *DbClient) GetWhiteListParicipants(participantID string) ([]string, error)

type InterfaceClient

type InterfaceClient interface {
	DeleteWhitelistParticipant(participantID, wlParticipant string) error
	AddWhitelistParticipant(participant, wlparticipant string) error
	GetWhiteListParicipants(participantID string) ([]string, error)
}

type Item

type Item struct {
	Participant string   `json:"_id" bson:"_id"`
	Whitelist   []string `json:"whitelist" bson:"whitelist"`
}

type MockDatabase

type MockDatabase struct {
	DeleteWLFlag                   bool
	DeleteWhitelistParticipantFunc func() error
	AddWLFlag                      bool
	AddWhitelistParticipantFunc    func() error
	GetWLFlag                      bool
	GetWhiteListParicipantsFunc    func() ([]string, error)
}

func DefaultMock

func DefaultMock() MockDatabase

func (*MockDatabase) AddWhitelistParticipant

func (mDB *MockDatabase) AddWhitelistParticipant(participant, wlparticipant string) error

func (*MockDatabase) DeleteWhitelistParticipant

func (mDB *MockDatabase) DeleteWhitelistParticipant(participantID, wlParticipant string) error

func (*MockDatabase) GetWhiteListParicipants

func (mDB *MockDatabase) GetWhiteListParicipants(participantID string) ([]string, error)

Jump to

Keyboard shortcuts

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