Documentation
¶
Index ¶
- Constants
- Variables
- func IsDefaultValue(column *ColumnSchema, nativeElem interface{}) bool
- func IsNamedUUID(uuid string) bool
- func IsValidUUID(uuid string) bool
- func NativeToOvs(column *ColumnSchema, rawElem interface{}) (interface{}, error)
- func NativeToOvsAtomic(basicType string, nativeElem interface{}) (interface{}, error)
- func NativeType(column *ColumnSchema) reflect.Type
- func NativeTypeFromAtomic(basicType string) reflect.Type
- func NewCancelArgs(id interface{}) []interface{}
- func NewEchoArgs() []interface{}
- func NewErrWrongType(from, expected string, got interface{}) error
- 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 NewMonitorCondSinceArgs(database string, value interface{}, requests map[string]MonitorRequest, ...) []interface{}
- func NewTransactArgs(database string, operations ...Operation) []interface{}
- func OvsToNative(column *ColumnSchema, ovsElem interface{}) (interface{}, error)
- func OvsToNativeAtomic(basicType string, ovsElem interface{}) (interface{}, error)
- func OvsToNativeSlice(baseType string, ovsElem interface{}) (interface{}, error)
- func ValidateCondition(column *ColumnSchema, function ConditionFunction, nativeValue interface{}) error
- func ValidateMutation(column *ColumnSchema, mutator Mutator, value interface{}) error
- func ValidateUUID(uuid string) error
- type Aborted
- type BaseType
- func (b BaseType) MarshalJSON() ([]byte, error)
- func (b *BaseType) MaxInteger() (int, error)
- func (b *BaseType) MaxLength() (int, error)
- func (b *BaseType) MaxReal() (float64, error)
- func (b *BaseType) MinInteger() (int, error)
- func (b *BaseType) MinLength() (int, error)
- func (b *BaseType) MinReal() (float64, error)
- func (b *BaseType) RefTable() (string, error)
- func (b *BaseType) RefType() (RefType, error)
- func (b *BaseType) UnmarshalJSON(data []byte) error
- type ColumnSchema
- type ColumnType
- type Condition
- type ConditionFunction
- type ConstraintViolation
- type DatabaseSchema
- type DomainError
- type DuplicateUUIDName
- type ErrWrongType
- type Error
- type ExtendedType
- type IOError
- type MonitorCondSinceReply
- type MonitorRequest
- type MonitorRequests
- type MonitorSelect
- type Mutation
- type Mutator
- type NotOwner
- type NotSupported
- type NotificationHandler
- type Operation
- type OperationError
- type OperationResult
- type OvsMap
- type OvsSet
- type RangeError
- type RefType
- type ReferentialIntegrityViolation
- type ResourcesExhausted
- type Row
- type RowUpdate
- type RowUpdate2
- type TableSchema
- type TableUpdate
- type TableUpdate2
- type TableUpdates
- type TableUpdates2
- type TimedOut
- type TransactResponse
- type UUID
- type WaitCondition
Constants ¶
const ( // ConditionLessThan is the less than condition ConditionLessThan ConditionFunction = "<" // ConditionLessThanOrEqual is the less than or equal condition ConditionLessThanOrEqual ConditionFunction = "<=" // ConditionEqual is the equal condition ConditionEqual ConditionFunction = "==" // ConditionNotEqual is the not equal condition ConditionNotEqual ConditionFunction = "!=" // ConditionGreaterThan is the greater than condition ConditionGreaterThan ConditionFunction = ">" // ConditionGreaterThanOrEqual is the greater than or equal condition ConditionGreaterThanOrEqual ConditionFunction = ">=" // ConditionIncludes is the includes condition ConditionIncludes ConditionFunction = "includes" // ConditionExcludes is the excludes condition ConditionExcludes ConditionFunction = "excludes" // WaitConditionEqual is the equal condition WaitConditionEqual WaitCondition = "==" // WaitConditionNotEqual is the not equal condition WaitConditionNotEqual WaitCondition = "!=" )
const ( // OperationInsert is an insert operation OperationInsert = "insert" // OperationSelect is a select operation OperationSelect = "select" // OperationUpdate is an update operation OperationUpdate = "update" // OperationMutate is a mutate operation OperationMutate = "mutate" // OperationDelete is a delete operation OperationDelete = "delete" // OperationWait is a wait operation OperationWait = "wait" // OperationCommit is a commit operation OperationCommit = "commit" // OperationAbort is an abort operation OperationAbort = "abort" // OperationComment is a comment operation OperationComment = "comment" // OperationAssert is an assert operation OperationAssert = "assert" )
const ( // MonitorRPC is the monitor RPC method MonitorRPC = "monitor" // ConditionalMonitorRPC is the monitor_cond ConditionalMonitorRPC = "monitor_cond" // ConditionalMonitorSinceRPC is the monitor_cond_since RPC method ConditionalMonitorSinceRPC = "monitor_cond_since" )
const ( //Strong RefType Strong RefType = "strong" //Weak RefType Weak RefType = "weak" //TypeInteger is equivalent to 'int' TypeInteger ExtendedType = "integer" //TypeReal is equivalent to 'float64' TypeReal ExtendedType = "real" //TypeBoolean is equivalent to 'bool' TypeBoolean ExtendedType = "boolean" //TypeString is equivalent to 'string' TypeString ExtendedType = "string" //TypeUUID is equivalent to 'libovsdb.UUID' TypeUUID ExtendedType = "uuid" //TypeEnum is an enumerator of type defined by Key.Type TypeEnum ExtendedType = "enum" //TypeMap is a map whose type depend on Key.Type and Value.Type TypeMap ExtendedType = "map" //TypeSet is a set whose type depend on Key.Type TypeSet ExtendedType = "set" )
Variables ¶
var UUIDColumn = ColumnSchema{ Type: TypeUUID, }
UUIDColumn is a static column that represents the _uuid column, common to all tables
var (
// Unlimited is used to express unlimited "Max"
Unlimited = -1
)
unlimited is not constant as we can't take the address of int constants
Functions ¶
func IsDefaultValue ¶
func IsDefaultValue(column *ColumnSchema, nativeElem interface{}) bool
IsDefaultValue checks if a provided native element corresponds to the default value of its designated column type
func IsNamedUUID ¶ added in v0.7.0
func IsValidUUID ¶ added in v0.7.0
func NativeToOvs ¶
func NativeToOvs(column *ColumnSchema, rawElem interface{}) (interface{}, error)
NativeToOvs transforms an native type to a ovs type based on the column type information
func NativeToOvsAtomic ¶ added in v0.6.0
NativeToOvsAtomic returns the OVS type of the atomic native value
func NativeType ¶
func NativeType(column *ColumnSchema) reflect.Type
NativeType returns the reflect.Type that can hold the value of a column OVS Type to Native Type convertions:
OVS sets -> go slices or a go native type depending on the key OVS uuid -> go strings OVS map -> go map OVS enum -> go native type depending on the type of the enum key
func NativeTypeFromAtomic ¶
NativeTypeFromAtomic returns the native type that can hold a value of an AtomicType
func NewCancelArgs ¶
func NewCancelArgs(id interface{}) []interface{}
NewCancelArgs creates a new set of arguments for a cancel RPC
func NewEchoArgs ¶ added in v0.4.0
func NewEchoArgs() []interface{}
NewEchoArgs creates a new set of arguments for an echo RPC
func NewErrWrongType ¶
NewErrWrongType creates a new ErrWrongType
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 NewMonitorCondSinceArgs ¶ added in v0.7.0
func NewMonitorCondSinceArgs(database string, value interface{}, requests map[string]MonitorRequest, lastTransactionID string) []interface{}
NewMonitorCondSinceArgs creates a new set of arguments for a monitor_cond_since RPC
func NewTransactArgs ¶
NewTransactArgs creates a new set of arguments for a transact RPC
func OvsToNative ¶
func OvsToNative(column *ColumnSchema, ovsElem interface{}) (interface{}, error)
OvsToNative transforms an ovs type to native one based on the column type information
func OvsToNativeAtomic ¶
OvsToNativeAtomic returns the native type of the basic ovs type
func OvsToNativeSlice ¶ added in v0.7.0
func ValidateCondition ¶ added in v0.4.0
func ValidateCondition(column *ColumnSchema, function ConditionFunction, nativeValue interface{}) error
func ValidateMutation ¶
func ValidateMutation(column *ColumnSchema, mutator Mutator, value interface{}) error
ValidateMutation checks if the mutation value and mutator string area appropriate for a given column based on the rules specified RFC7047
func ValidateUUID ¶ added in v0.7.0
Types ¶
type Aborted ¶ added in v0.4.0
type Aborted struct {
// contains filtered or unexported fields
}
Aborted is described in RFC 7047: 5.2.8
type BaseType ¶
type BaseType struct { Type string Enum []interface{} // contains filtered or unexported fields }
BaseType is a base-type structure as per RFC7047
func (BaseType) MarshalJSON ¶ added in v0.4.0
MarshalJSON marshals a base type to JSON
func (*BaseType) MaxInteger ¶
MaxInteger returns the minimum integer value RFC7047 specifies the minimum to be 2^63-1
func (*BaseType) MaxLength ¶
MaxLength returns the maximum string length RFC7047 doesn't specify a default, but we assume that it must 2^63-1
func (*BaseType) MaxReal ¶
MaxReal returns the maximum real value RFC7047 does not define a default, but this would be the maximum value held by a float64
func (*BaseType) MinInteger ¶
MinInteger returns the minimum integer value RFC7047 specifies the minimum to be -2^63
func (*BaseType) MinLength ¶
MinLength returns the minimum string length RFC7047 doesn't specify a default, but we assume that it must be >= 0
func (*BaseType) MinReal ¶
MinReal returns the minimum real value RFC7047 does not define a default, but we assume this to be the smallest non zero value a float64 could hold
func (*BaseType) RefTable ¶
RefTable returns the table to which a UUID type refers It will return an empty string if not set
func (*BaseType) RefType ¶
RefType returns the reference type for a UUID field RFC7047 infers the RefType is strong if omitted
func (*BaseType) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON unmarshals a json-formatted base type
type ColumnSchema ¶
type ColumnSchema struct { // According to RFC7047, "type" field can be, either an <atomic-type> // Or a ColumnType defined below. To try to simplify the usage, the // json message will be parsed manually and Type will indicate the "extended" // type. Depending on its value, more information may be available in TypeObj. // E.g: If Type == TypeEnum, TypeObj.Key.Enum contains the possible values Type ExtendedType TypeObj *ColumnType // contains filtered or unexported fields }
ColumnSchema is a column schema according to RFC7047
func (*ColumnSchema) Ephemeral ¶
func (c *ColumnSchema) Ephemeral() bool
Ephemeral returns whether a column is ephemeral
func (ColumnSchema) MarshalJSON ¶ added in v0.4.0
func (c ColumnSchema) MarshalJSON() ([]byte, error)
MarshalJSON marshalls a column schema to JSON
func (*ColumnSchema) Mutable ¶
func (c *ColumnSchema) Mutable() bool
Mutable returns whether a column is mutable
func (*ColumnSchema) String ¶
func (c *ColumnSchema) String() string
String returns a string representation of the (native) column type
func (*ColumnSchema) UnmarshalJSON ¶
func (c *ColumnSchema) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals a json-formatted column
type ColumnType ¶
ColumnType is a type object as per RFC7047 "key": <base-type> required "value": <base-type> optional "min": <integer> optional (default: 1) "max": <integer> or "unlimited" optional (default: 1)
func (ColumnType) MarshalJSON ¶ added in v0.4.0
func (c ColumnType) MarshalJSON() ([]byte, error)
MarshalJSON marshalls a column type to JSON
func (*ColumnType) Max ¶
func (c *ColumnType) Max() int
Max returns the maximum value of a ColumnType. -1 is Unlimited
func (*ColumnType) Min ¶
func (c *ColumnType) Min() int
Min returns the minimum value of a ColumnType
func (*ColumnType) UnmarshalJSON ¶ added in v0.4.0
func (c *ColumnType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals a json-formatted column type
type Condition ¶ added in v0.4.0
type Condition struct { Column string Function ConditionFunction Value interface{} }
Condition is described in RFC 7047: 5.1
func NewCondition ¶
func NewCondition(column string, function ConditionFunction, value interface{}) Condition
NewCondition returns a new condition
func (Condition) MarshalJSON ¶ added in v0.4.0
MarshalJSON marshals a condition to a 3 element JSON array
func (*Condition) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON converts a 3 element JSON array to a Condition
type ConditionFunction ¶ added in v0.4.0
type ConditionFunction string
func (ConditionFunction) Evaluate ¶ added in v0.4.0
func (c ConditionFunction) Evaluate(a interface{}, b interface{}) (bool, error)
Evaluate will evaluate the condition on the two provided values The conditions operately differently depending on the type of the provided values. The behavior is as described in RFC7047
type ConstraintViolation ¶ added in v0.4.0
type ConstraintViolation struct {
// contains filtered or unexported fields
}
ConstraintViolation is described in RFC 7047: 4.1.3
func NewConstraintViolation ¶ added in v0.7.0
func NewConstraintViolation(details string) *ConstraintViolation
func (*ConstraintViolation) Error ¶ added in v0.4.0
func (e *ConstraintViolation) Error() string
Error implements the error interface
func (*ConstraintViolation) Operation ¶ added in v0.4.0
func (e *ConstraintViolation) Operation() *Operation
Operation implements the OperationError interface
type DatabaseSchema ¶
type DatabaseSchema struct { Name string `json:"name"` Version string `json:"version"` Tables map[string]TableSchema `json:"tables"` // contains filtered or unexported fields }
DatabaseSchema is a database schema according to RFC7047
func SchemaFromFile ¶ added in v0.4.0
func SchemaFromFile(f *os.File) (DatabaseSchema, error)
SchemaFromFile returns a DatabaseSchema from a file
func (DatabaseSchema) IsRoot ¶ added in v0.7.0
func (schema DatabaseSchema) IsRoot(tableName string) (bool, error)
IsRoot whether a table is root or not
func (DatabaseSchema) Print ¶
func (schema DatabaseSchema) Print(w io.Writer)
Print will print the contents of the DatabaseSchema
func (DatabaseSchema) Table ¶
func (schema DatabaseSchema) Table(tableName string) *TableSchema
Table returns a TableSchema Schema for a given table and column name
func (DatabaseSchema) ValidateOperations ¶
func (schema DatabaseSchema) ValidateOperations(operations ...Operation) bool
ValidateOperations performs basic validation for operations against a DatabaseSchema
type DomainError ¶ added in v0.4.0
type DomainError struct {
// contains filtered or unexported fields
}
DomainError is described in RFC 7047: 5.2.4
func (*DomainError) Error ¶ added in v0.4.0
func (e *DomainError) Error() string
Error implements the error interface
func (*DomainError) Operation ¶ added in v0.4.0
func (e *DomainError) Operation() *Operation
Operation implements the OperationError interface
type DuplicateUUIDName ¶ added in v0.4.0
type DuplicateUUIDName struct {
// contains filtered or unexported fields
}
DuplicateUUIDName is described in RFC7047 5.2.1
func (*DuplicateUUIDName) Error ¶ added in v0.4.0
func (e *DuplicateUUIDName) Error() string
Error implements the error interface
func (*DuplicateUUIDName) Operation ¶ added in v0.4.0
func (e *DuplicateUUIDName) Operation() *Operation
Operation implements the OperationError interface
type ErrWrongType ¶
type ErrWrongType struct {
// contains filtered or unexported fields
}
ErrWrongType describes typing error
func (*ErrWrongType) Error ¶
func (e *ErrWrongType) Error() string
type Error ¶ added in v0.4.0
type Error struct {
// contains filtered or unexported fields
}
Error is a generic OVSDB Error type that implements the OperationError and error interfaces
type ExtendedType ¶
type ExtendedType = string
ExtendedType includes atomic types as defined in the RFC plus Enum, Map and Set
type IOError ¶ added in v0.4.0
type IOError struct {
// contains filtered or unexported fields
}
IOError is described in RFC7047: 4.1.3
type MonitorCondSinceReply ¶ added in v0.7.0
type MonitorCondSinceReply struct { Found bool LastTransactionID string Updates TableUpdates2 }
func (MonitorCondSinceReply) MarshalJSON ¶ added in v0.7.0
func (m MonitorCondSinceReply) MarshalJSON() ([]byte, error)
func (*MonitorCondSinceReply) UnmarshalJSON ¶ added in v0.7.0
func (m *MonitorCondSinceReply) UnmarshalJSON(b []byte) error
type MonitorRequest ¶
type MonitorRequest struct { Columns []string `json:"columns,omitempty"` Where []Condition `json:"where,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"`
}
MonitorRequests represents a group of monitor requests according to RFC7047 We cannot use MonitorRequests by inlining the MonitorRequest Map structure till GoLang issue #6213 makes it. The only option is to go with raw map[string]interface{} option :-( that sucks ! Refer to client.go : MonitorAll() function for more details
type MonitorSelect ¶
type MonitorSelect struct {
// contains filtered or unexported fields
}
MonitorSelect represents a monitor select according to RFC7047
func NewDefaultMonitorSelect ¶ added in v0.4.0
func NewDefaultMonitorSelect() *MonitorSelect
NewDefaultMonitorSelect returns a new MonitorSelect with default values
func NewMonitorSelect ¶ added in v0.4.0
func NewMonitorSelect(initial, insert, delete, modify bool) *MonitorSelect
NewMonitorSelect returns a new MonitorSelect with the provided values
func (MonitorSelect) Delete ¶
func (m MonitorSelect) Delete() bool
Delete returns whether we will receive updates for deletions
func (MonitorSelect) Initial ¶
func (m MonitorSelect) Initial() bool
Initial returns whether or not an initial response will be sent
func (MonitorSelect) Insert ¶
func (m MonitorSelect) Insert() bool
Insert returns whether we will receive updates for inserts
func (MonitorSelect) MarshalJSON ¶ added in v0.4.0
func (m MonitorSelect) MarshalJSON() ([]byte, error)
func (MonitorSelect) Modify ¶
func (m MonitorSelect) Modify() bool
Modify returns whether we will receive updates for modifications
func (*MonitorSelect) UnmarshalJSON ¶ added in v0.4.0
func (m *MonitorSelect) UnmarshalJSON(data []byte) error
type Mutation ¶ added in v0.4.0
Mutation is described in RFC 7047: 5.1
func NewMutation ¶
NewMutation returns a new mutation
func (Mutation) MarshalJSON ¶ added in v0.4.0
MarshalJSON marshals a mutation to a 3 element JSON array
func (*Mutation) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON converts a 3 element JSON array to a Mutation
type Mutator ¶
type Mutator string
const ( // MutateOperationDelete is the delete mutator MutateOperationDelete Mutator = "delete" // MutateOperationInsert is the insert mutator MutateOperationInsert Mutator = "insert" // MutateOperationAdd is the add mutator MutateOperationAdd Mutator = "+=" // MutateOperationSubtract is the subtract mutator MutateOperationSubtract Mutator = "-=" // MutateOperationMultiply is the multiply mutator MutateOperationMultiply Mutator = "*=" // MutateOperationDivide is the divide mutator MutateOperationDivide Mutator = "/=" // MutateOperationModulo is the modulo mutator MutateOperationModulo Mutator = "%=" )
type NotOwner ¶ added in v0.4.0
type NotOwner struct {
// contains filtered or unexported fields
}
NotOwner is described in RFC 7047: 5.2.9
type NotSupported ¶ added in v0.4.0
type NotSupported struct {
// contains filtered or unexported fields
}
NotSupported is described in RFC 7047: 5.2.7
func (*NotSupported) Error ¶ added in v0.4.0
func (e *NotSupported) Error() string
Error implements the error interface
func (*NotSupported) Operation ¶ added in v0.4.0
func (e *NotSupported) Operation() *Operation
Operation implements the OperationError interface
type NotificationHandler ¶
type NotificationHandler interface { // RFC 7047 section 4.1.6 Update Notification Update(context interface{}, tableUpdates TableUpdates) // ovsdb-server.7 update2 notifications Update2(context interface{}, tableUpdates TableUpdates2) // 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() }
NotificationHandler is the interface that must be implemented to receive notifications
type Operation ¶
type Operation struct { Op string `json:"op"` Table string `json:"table,omitempty"` Row Row `json:"row,omitempty"` Rows []Row `json:"rows,omitempty"` Columns []string `json:"columns,omitempty"` Mutations []Mutation `json:"mutations,omitempty"` Timeout *int `json:"timeout,omitempty"` Where []Condition `json:"where,omitempty"` Until string `json:"until,omitempty"` Durable *bool `json:"durable,omitempty"` Comment *string `json:"comment,omitempty"` Lock *string `json:"lock,omitempty"` UUID string `json:"uuid,omitempty"` UUIDName string `json:"uuid-name,omitempty"` }
Operation represents an operation according to RFC7047 section 5.2
func ExpandNamedUUIDs ¶ added in v0.7.0
func ExpandNamedUUIDs(ops []Operation, schema *DatabaseSchema) ([]Operation, error)
ExpandNamedUUIDs replaces named UUIDs in columns that contain UUID types throughout the operation. The caller must ensure each input operation has a valid UUID, which may be replaced if a previous operation created a matching named UUID mapping. Returns the updated operations or an error.
func (Operation) MarshalJSON ¶
MarshalJSON marshalls 'Operation' to a byte array For 'select' operations, we don't omit the 'Where' field to allow selecting all rows of a table
type OperationError ¶ added in v0.4.0
type OperationError interface { error // Operation is a pointer to the operation which caused the error Operation() *Operation }
OperationError represents an error that occurred as part of an OVSDB Operation
func CheckOperationResults ¶ added in v0.4.0
func CheckOperationResults(result []OperationResult, ops []Operation) ([]OperationError, error)
CheckOperationResults checks whether the provided operation was a success If the operation was a success, it will return nil, nil If the operation failed, due to a error committing the transaction it will return nil, error. Finally, in the case where one or more of the operations in the transaction failed, we return []OperationErrors, error Within []OperationErrors, the OperationErrors.Index() corresponds to the same index in the original Operations struct. You may also perform type assertions against the error so the caller can decide how best to handle it
type OperationResult ¶
type OperationResult struct { Count int `json:"count,omitempty"` Error string `json:"error,omitempty"` Details string `json:"details,omitempty"` UUID UUID `json:"uuid,omitempty"` Rows []Row `json:"rows,omitempty"` }
OperationResult is the result of an Operation
func ResultFromError ¶ added in v0.7.0
func ResultFromError(err error) OperationResult
type OvsMap ¶
type OvsMap struct {
GoMap map[interface{}]interface{}
}
OvsMap is the JSON map structure used for OVSDB RFC 7047 uses the following notation for map as JSON doesn't support non-string keys for maps. A 2-element JSON array that represents a database map value. The first element of the array must be the string "map", and the second element must be an array of zero or more <pair>s giving the values in the map. All of the <pair>s must have the same key and value types.
func (OvsMap) MarshalJSON ¶
MarshalJSON marshalls an OVSDB style Map to a byte array
func (*OvsMap) UnmarshalJSON ¶
UnmarshalJSON unmarshals an OVSDB style Map from a byte array
type OvsSet ¶
type OvsSet struct {
GoSet []interface{}
}
OvsSet is an OVSDB style set RFC 7047 has a weird (but understandable) notation for set as described as : Either an <atom>, representing a set with exactly one element, or a 2-element JSON array that represents a database set value. The first element of the array must be the string "set", and the second element must be an array of zero or more <atom>s giving the values in the set. All of the <atom>s must have the same type.
func (OvsSet) MarshalJSON ¶
MarshalJSON wil marshal an OVSDB style Set in to a JSON byte array
func (*OvsSet) UnmarshalJSON ¶
UnmarshalJSON will unmarshal a JSON byte array to an OVSDB style Set
type RangeError ¶ added in v0.4.0
type RangeError struct {
// contains filtered or unexported fields
}
RangeError is described in RFC 7047: 5.2.4
func (*RangeError) Error ¶ added in v0.4.0
func (e *RangeError) Error() string
Error implements the error interface
func (*RangeError) Operation ¶ added in v0.4.0
func (e *RangeError) Operation() *Operation
Operation implements the OperationError interface
type ReferentialIntegrityViolation ¶ added in v0.4.0
type ReferentialIntegrityViolation struct {
// contains filtered or unexported fields
}
ReferentialIntegrityViolation is explained in RFC 7047 4.1.3
func NewReferentialIntegrityViolation ¶ added in v0.7.0
func NewReferentialIntegrityViolation(details string) *ReferentialIntegrityViolation
func (*ReferentialIntegrityViolation) Error ¶ added in v0.4.0
func (e *ReferentialIntegrityViolation) Error() string
Error implements the error interface
func (*ReferentialIntegrityViolation) Operation ¶ added in v0.4.0
func (e *ReferentialIntegrityViolation) Operation() *Operation
Operation implements the OperationError interface
type ResourcesExhausted ¶ added in v0.4.0
type ResourcesExhausted struct {
// contains filtered or unexported fields
}
ResourcesExhausted is described in RFC 7047: 4.1.3
func (*ResourcesExhausted) Error ¶ added in v0.4.0
func (e *ResourcesExhausted) Error() string
Error implements the error interface
func (*ResourcesExhausted) Operation ¶ added in v0.4.0
func (e *ResourcesExhausted) Operation() *Operation
Operation implements the OperationError interface
type Row ¶
type Row map[string]interface{}
Row is a table Row according to RFC7047
func (*Row) UnmarshalJSON ¶
UnmarshalJSON unmarshalls a byte array to an OVSDB Row
type RowUpdate ¶
RowUpdate represents a row update according to RFC7047
func (RowUpdate) Delete ¶ added in v0.4.0
Delete returns true if this is an update for a delete operation
func (*RowUpdate) FromRowUpdate2 ¶ added in v0.7.0
func (r *RowUpdate) FromRowUpdate2(ru2 RowUpdate2)
type RowUpdate2 ¶ added in v0.7.0
type RowUpdate2 struct { Initial *Row `json:"initial,omitempty"` Insert *Row `json:"insert,omitempty"` Modify *Row `json:"modify,omitempty"` Delete *Row `json:"delete,omitempty"` Old *Row `json:"-"` New *Row `json:"-"` }
RowUpdate2 represents a row update according to ovsdb-server.7
type TableSchema ¶
type TableSchema struct { Columns map[string]*ColumnSchema `json:"columns"` Indexes [][]string `json:"indexes,omitempty"` IsRoot bool `json:"isRoot,omitempty"` }
TableSchema is a table schema according to RFC7047
func (TableSchema) Column ¶
func (t TableSchema) Column(columnName string) *ColumnSchema
Column returns the Column object for a specific column name
type TableUpdate ¶
TableUpdate is an object that maps from the row's UUID to a RowUpdate
type TableUpdate2 ¶ added in v0.7.0
type TableUpdate2 map[string]*RowUpdate2
TableUpdate2 is an object that maps from the row's UUID to a RowUpdate2
type TableUpdates ¶
type TableUpdates map[string]TableUpdate
TableUpdates is an object that maps from a table name to a TableUpdate
type TableUpdates2 ¶ added in v0.7.0
type TableUpdates2 map[string]TableUpdate2
TableUpdates2 is an object that maps from a table name to a TableUpdate2
type TimedOut ¶ added in v0.4.0
type TimedOut struct {
// contains filtered or unexported fields
}
TimedOut is described in RFC 7047: 5.2.6
type TransactResponse ¶
type TransactResponse struct { Result []OperationResult `json:"result"` Error string `json:"error"` }
TransactResponse represents the response to a Transact Operation
type UUID ¶
type UUID struct {
GoUUID string `json:"uuid"`
}
UUID is a UUID according to RFC7047
func (UUID) MarshalJSON ¶
MarshalJSON will marshal an OVSDB style UUID to a JSON encoded byte array
func (*UUID) UnmarshalJSON ¶
UnmarshalJSON will unmarshal a JSON encoded byte array to a OVSDB style UUID
type WaitCondition ¶ added in v0.7.0
type WaitCondition string