Documentation
¶
Index ¶
- func DialNet(network, address string) (net.Conn, error)
- type Cache
- type Error
- type Lock
- type OVSDB
- func (ovsdb *OVSDB) AddCallBack(id string, callback dbmonitor.Callback)
- func (ovsdb *OVSDB) Cache(c Cache) (*dbcache.Cache, error)
- func (ovsdb *OVSDB) Call(method string, args interface{}, idref *uint64) (json.RawMessage, error)
- func (ovsdb *OVSDB) Close() error
- func (ovsdb *OVSDB) GetCounter() uint64
- func (ovsdb *OVSDB) GetSchema(schema string) (json.RawMessage, error)
- func (ovsdb *OVSDB) ListDbs() []string
- func (ovsdb *OVSDB) Lock(id string) (interface{}, error)
- func (ovsdb *OVSDB) Monitor(schema string) *dbmonitor.Monitor
- func (ovsdb *OVSDB) Notify(method string, args interface{}) error
- func (ovsdb *OVSDB) RegisterLockedCallback(Callback func(string))
- func (ovsdb *OVSDB) RegisterStolenCallback(Callback func(string))
- func (ovsdb *OVSDB) Steal(id string) (interface{}, error)
- func (ovsdb *OVSDB) Transaction(schema string) *dbtransaction.Transaction
- func (ovsdb *OVSDB) Unlock(id string) (interface{}, error)
- type Pending
- type Synchronize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OVSDB ¶
ovsdb session handle structure
func Dial ¶
func Dial(addressList [][]string, initialize func(*OVSDB) error, options map[string]interface{}) *OVSDB
PersistentDial provides automatic reconnection in case of connection failure. Reconnection will be performed with each provided address. After unsuccessfully trying all addresses it will sleep for 1,2,4,8,8,8,... seconds before trying again. Initialize will be called after every successful connection to db. Function will lock until first successful connect. Returns a pointer to db which will point to new db structure on each connect.
func (*OVSDB) Call ¶
call sends request to server and blocks after it is unblocked in incoming message receiver loop it returns response from server as raw data to be unmarshaled later
func (*OVSDB) GetCounter ¶
func (*OVSDB) GetSchema ¶
func (ovsdb *OVSDB) GetSchema(schema string) (json.RawMessage, error)
GetSchema returns schema object containing all db schema data
func (*OVSDB) RegisterLockedCallback ¶
func (*OVSDB) RegisterStolenCallback ¶
func (*OVSDB) Transaction ¶
func (ovsdb *OVSDB) Transaction(schema string) *dbtransaction.Transaction
Transaction returns transaction handle
type Synchronize ¶
type Synchronize struct {
// contains filtered or unexported fields
}
helper structure for synchronizing db connection and socket reads and writes
func (*Synchronize) SetConnected ¶
func (s *Synchronize) SetConnected()
func (*Synchronize) SetError ¶
func (s *Synchronize) SetError()
func (*Synchronize) SetInitialized ¶
func (s *Synchronize) SetInitialized()
func (*Synchronize) WaitConnected ¶
func (s *Synchronize) WaitConnected() bool
if not connected waits until connection is established
func (*Synchronize) WaitError ¶
func (s *Synchronize) WaitError()
if there is no socket error, locks and waits until socket errors
func (*Synchronize) WaitInitialized ¶
func (s *Synchronize) WaitInitialized()
if not initialized waits until initialization callback is completed