Documentation
¶
Index ¶
- Constants
- func NewCancelArgs(id interface{}) []interface{}
- func NewCondition(column string, function string, value interface{}) []interface{}
- func NewGetSchemaArgs(schema string) []interface{}
- func NewLockArgs(id interface{}) []interface{}
- func NewMonitorArgs(database string, value interface{}, requests map[string]MonitorRequest) []interface{}
- func NewMonitorCancelArgs(value interface{}) []interface{}
- func NewMutation(column string, mutator string, value interface{}) []interface{}
- func NewTransactArgs(database string, operations ...Operation) []interface{}
- type ColumnSchema
- type DatabaseSchema
- type MonitorRequest
- type MonitorRequests
- type MonitorSelect
- type NotificationHandler
- type Operation
- type OperationResult
- type OvsMap
- type OvsSet
- type OvsdbClient
- func (ovs OvsdbClient) Disconnect()
- func (ovs OvsdbClient) GetSchema(dbName string) (*DatabaseSchema, error)
- func (ovs OvsdbClient) ListDbs() ([]string, error)
- func (ovs OvsdbClient) Monitor(database string, jsonContext interface{}, requests map[string]MonitorRequest) (*TableUpdates, error)
- func (ovs OvsdbClient) MonitorAll(database string, jsonContext interface{}) (*TableUpdates, error)
- func (ovs *OvsdbClient) Register(handler NotificationHandler)
- func (ovs OvsdbClient) Transact(database string, operation ...Operation) ([]OperationResult, error)
- type OvsdbError
- type Row
- type RowUpdate
- type TableSchema
- type TableUpdate
- type TableUpdates
- type TransactResponse
- type UUID
Constants ¶
const DEFAULT_ADDR = "127.0.0.1"
const DEFAULT_PORT = 6640
Variables ¶
This section is empty.
Functions ¶
func NewCancelArgs ¶
func NewCancelArgs(id interface{}) []interface{}
NewCancelArgs creates a new set of arguments for a cancel RPC
func NewCondition ¶
NewCondition creates a new condition as specified in RFC7047
func NewGetSchemaArgs ¶
func NewGetSchemaArgs(schema string) []interface{}
NewGetSchemaArgs creates a new set of arguments for a get_schemas RPC
func NewLockArgs ¶
func NewLockArgs(id interface{}) []interface{}
NewLockArgs creates a new set of arguments for a lock, steal or unlock RPC
func NewMonitorArgs ¶
func NewMonitorArgs(database string, value interface{}, requests map[string]MonitorRequest) []interface{}
NewMonitorArgs creates a new set of arguments for a monitor RPC
func NewMonitorCancelArgs ¶
func NewMonitorCancelArgs(value interface{}) []interface{}
NewMonitorCancelArgs creates a new set of arguments for a monitor_cancel RPC
func NewMutation ¶
NewMutation creates a new mutation as specified in RFC7047
Types ¶
type ColumnSchema ¶
type DatabaseSchema ¶
type DatabaseSchema struct {
Name string `json:"name"`
Version string `json:"version"`
Tables map[string]TableSchema `json:"tables"`
}
func (DatabaseSchema) Print ¶
func (schema DatabaseSchema) Print(w io.Writer)
type MonitorRequest ¶
type MonitorRequest struct {
Columns []string `json:"columns,omitempty"`
Select MonitorSelect `json:"select,omitempty"`
}
MonitorRequest represents a monitor request according to RFC7047
type MonitorRequests ¶
type MonitorRequests struct {
Requests map[string]MonitorRequest `json:"requests,overflow"`
}
type MonitorSelect ¶
type MonitorSelect struct {
Initial bool `json:"initial,omitempty"`
Insert bool `json:"insert,omitempty"`
Delete bool `json:"delete,omitempty"`
Modify bool `json:"modify,omitempty"`
}
MonitorSelect represents a monitor select according to RFC7047
type NotificationHandler ¶
type NotificationHandler interface {
// RFC 7047 section 4.1.6 Update Notification
Update(context interface{}, tableUpdates TableUpdates)
// RFC 7047 section 4.1.9 Locked Notification
Locked([]interface{})
// RFC 7047 section 4.1.10 Stolen Notification
Stolen([]interface{})
// RFC 7047 section 4.1.11 Echo Notification
Echo([]interface{})
Disconnected(*OvsdbClient)
}
type Operation ¶
type Operation struct {
Op string `json:"op"`
Table string `json:"table"`
Row map[string]interface{} `json:"row,omitempty"`
Rows []map[string]interface{} `json:"rows,omitempty"`
Columns []string `json:"columns,omitempty"`
Mutations []interface{} `json:"mutations,omitempty"`
Timeout int `json:"timeout,omitempty"`
Where []interface{} `json:"where,omitempty"`
Until string `json:"until,omitempty"`
UUIDName string `json:"uuid-name,omitempty"`
}
Operation represents an operation according to RFC7047 section 5.2
type OperationResult ¶
type OvsMap ¶
type OvsMap struct {
GoMap map[interface{}]interface{}
}
func NewOvsMap ¶
<map> notation requires special marshaling
func (OvsMap) MarshalJSON ¶
<map> notation requires special handling
type OvsSet ¶
type OvsSet struct {
GoSet []interface{}
}
func NewOvsSet ¶
<set> notation requires special handling
func (OvsSet) MarshalJSON ¶
<set> notation requires special marshaling
type OvsdbClient ¶
type OvsdbClient struct {
Schema map[string]DatabaseSchema
// contains filtered or unexported fields
}
func Connect ¶
func Connect(ipAddr string, port int) (*OvsdbClient, error)
func (OvsdbClient) Disconnect ¶
func (ovs OvsdbClient) Disconnect()
func (OvsdbClient) GetSchema ¶
func (ovs OvsdbClient) GetSchema(dbName string) (*DatabaseSchema, error)
RFC 7047 : get_schema
func (OvsdbClient) Monitor ¶
func (ovs OvsdbClient) Monitor(database string, jsonContext interface{}, requests map[string]MonitorRequest) (*TableUpdates, error)
RFC 7047 : monitor
func (OvsdbClient) MonitorAll ¶
func (ovs OvsdbClient) MonitorAll(database string, jsonContext interface{}) (*TableUpdates, error)
Convenience method to monitor every table/column
func (*OvsdbClient) Register ¶
func (ovs *OvsdbClient) Register(handler NotificationHandler)
func (OvsdbClient) Transact ¶
func (ovs OvsdbClient) Transact(database string, operation ...Operation) ([]OperationResult, error)
type OvsdbError ¶
OvsdbError is an OVS Error Condition
type RowUpdate ¶
type TableSchema ¶
type TableSchema struct {
Columns map[string]ColumnSchema `json:"columns"`
Indexes [][]string `json:"indexes,omitempty"`
}
type TableUpdates ¶
type TableUpdates struct {
Updates map[string]TableUpdate `json:"updates,overflow"`
}
* We cannot use TableUpdates directly by json encoding by inlining the TableUpdate Map * structure till GoLang issue #6213 makes it. * * The only option is to go with raw map[string]map[string]interface{} option :-( that sucks ! * Refer to client.go : MonitorAll() function for more details
type TransactResponse ¶
type TransactResponse struct {
Result []OperationResult `json:"result"`
Error string `json:"error"`
}
Source Files
¶
- client.go
- map.go
- notation.go
- row.go
- rpc.go
- schema.go
- set.go
- uuid.go

