Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type Config
- type MockConnector
- func (d MockConnector) Create(table, resourceID, data string) error
- func (d MockConnector) Delete(table, resourceID string) (err error)
- func (d MockConnector) DeleteKeySetMembers(key string, member string) (err error)
- func (d MockConnector) Get(table, resourceID string) (string, error)
- func (d MockConnector) GetAllMatchingKeys(table, pattern string) ([]string, error)
- func (d MockConnector) GetKeySetMembers(key string) (list []string, err error)
- func (d MockConnector) Update(table, resourceID, data string) error
- func (d MockConnector) UpdateKeySet(key string, member string) (err error)
- type RedisExternalCalls
Constants ¶
const ( // TableFabric is the table for storing switch and pod ids TableFabric = "ACI-Fabric" // TableSwitch is the table for storing switch information TableSwitch = "ACI-Switch" // TableSwitchChassis is the table for storing switch chassis information TableSwitchChassis = "ACI-SwitchChassis" // TableSwitchPorts is the table for storing ports of each switch TableSwitchPorts = "ACI-SwitchPorts" // TablePort is the table for storing port information TablePort = "ACI-Port" // TableZone is the table for storing zone information TableZone = "ACI-Zone" // TableAddressPool is the table for storing addresspool information TableAddressPool = "ACI-AddressPool" // TableEndPoint is the table for storing fabric endpoint information TableEndPoint = "ACI-EndPoint" // TableZoneDomain is the table for storing ZoneToDomainDN information TableZoneDomain = "ACI-ZoneDomain" )
Variables ¶
var ( errors.New("Failed to establish connection with the DB") // ErrorKeyAlreadyExist is for identifing already exist error ErrorKeyAlreadyExist = errors.New("Key already exist in DB") // ErrorKeyNotFound is for identifing not found error ErrorKeyNotFound = errors.New("Key not Found in DB") )ErrorServiceUnavailable =
Using below variables as part of errors will enabling errors.Is() function
var Connector dbCalls
Connector is the interface which connects the DB functions
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the established connection
type Config ¶
type Config struct { Port string Protocol string Host string SentinelHost string SentinelPort string MasterSet string Password string }
Config is the configuration for db which is set by the wrapper package.
Port is the port number for the database connection Protocol is the type of protocol with which the connection takes place Host is hostname/IP on which the database is running
type MockConnector ¶
type MockConnector struct{}
MockConnector is for mocking DB connector interface
func (MockConnector) Create ¶
func (d MockConnector) Create(table, resourceID, data string) error
Create is for mocking DB Create operation
func (MockConnector) Delete ¶
func (d MockConnector) Delete(table, resourceID string) (err error)
Delete is for mocking DB Delete operation
func (MockConnector) DeleteKeySetMembers ¶
func (d MockConnector) DeleteKeySetMembers(key string, member string) (err error)
DeleteKeySetMembers is for mocking DB SREM operation
func (MockConnector) Get ¶
func (d MockConnector) Get(table, resourceID string) (string, error)
Get is for mocking DB Get operation
func (MockConnector) GetAllMatchingKeys ¶
func (d MockConnector) GetAllMatchingKeys(table, pattern string) ([]string, error)
GetAllMatchingKeys is for mocking GetAllMatchingKeys operation
func (MockConnector) GetKeySetMembers ¶
func (d MockConnector) GetKeySetMembers(key string) (list []string, err error)
GetKeySetMembers is for mocking DB SMEMBERS operation
func (MockConnector) Update ¶
func (d MockConnector) Update(table, resourceID, data string) error
Update is for mocking DB Update operation
func (MockConnector) UpdateKeySet ¶
func (d MockConnector) UpdateKeySet(key string, member string) (err error)
UpdateKeySet is for mocking DB SADD operation
type RedisExternalCalls ¶
type RedisExternalCalls interface {
// contains filtered or unexported methods
}
RedisExternalCalls containes the methods to make calls to external client libraries of Redis DB