ovsdb

package
v0.0.0-...-9bbdfad Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialNet

func DialNet(network, address string) (net.Conn, error)

Types

type Cache

type Cache struct {
	Schema  string
	Tables  map[string][]string
	Indexes map[string][]string
}

type Error

type Error struct {
	Syntax  string `json:"syntax"`
	Details string `json:"details"`
	Error   string `json:"error"`
}

type Lock

type Lock struct {
	Locked bool
}

type OVSDB

type OVSDB struct {
	Conn net.Conn
	ID   string
	// contains filtered or unexported fields
}

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) AddCallBack

func (ovsdb *OVSDB) AddCallBack(id string, callback dbmonitor.Callback)

func (*OVSDB) Cache

func (ovsdb *OVSDB) Cache(c Cache) (*dbcache.Cache, error)

func (*OVSDB) Call

func (ovsdb *OVSDB) Call(method string, args interface{}, idref *uint64) (json.RawMessage, error)

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) Close

func (ovsdb *OVSDB) Close() error

closes ovsdb network connection

func (*OVSDB) GetCounter

func (ovsdb *OVSDB) GetCounter() uint64

func (*OVSDB) GetSchema

func (ovsdb *OVSDB) GetSchema(schema string) (json.RawMessage, error)

GetSchema returns schema object containing all db schema data

func (*OVSDB) ListDbs

func (ovsdb *OVSDB) ListDbs() []string

ListDbs returns list of databases

func (*OVSDB) Lock

func (ovsdb *OVSDB) Lock(id string) (interface{}, error)

func (*OVSDB) Monitor

func (ovsdb *OVSDB) Monitor(schema string) *dbmonitor.Monitor

func (*OVSDB) Notify

func (ovsdb *OVSDB) Notify(method string, args interface{}) error

func (*OVSDB) RegisterLockedCallback

func (ovsdb *OVSDB) RegisterLockedCallback(Callback func(string))

func (*OVSDB) RegisterStolenCallback

func (ovsdb *OVSDB) RegisterStolenCallback(Callback func(string))

func (*OVSDB) Steal

func (ovsdb *OVSDB) Steal(id string) (interface{}, error)

func (*OVSDB) Transaction

func (ovsdb *OVSDB) Transaction(schema string) *dbtransaction.Transaction

Transaction returns transaction handle

func (*OVSDB) Unlock

func (ovsdb *OVSDB) Unlock(id string) (interface{}, error)

type Pending

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

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

Jump to

Keyboard shortcuts

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