dbtransaction

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: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNil

func GetNil() []interface{}

Unset value in OVSDB is represented as empty set

Types

type ActionResponse

type ActionResponse struct {
	Rows    []interface{} `json:"rows"`
	UUID    UUID
	Error   string
	Details string
}

type Delete

type Delete struct {
	Table string
	Where [][]interface{}
}

type DeleteReferences

type DeleteReferences struct {
	Table           string
	WhereId         string
	ReferenceColumn string
	DeleteIdsList   []string
	CurrentIdsList  []string // can be passed for performance reasons
	Wait            bool
	Cache           *dbcache.Cache
	LockChannel     chan int // used for locking for testing purposes
}

type Insert

type Insert struct {
	Table string
	Row   interface{}
}

type InsertReferences

type InsertReferences struct {
	Table                 string
	WhereId               string
	ReferenceColumn       string
	InsertIdsList         []string
	InsertExistingIdsList []string
	CurrentIdsList        []string
	Wait                  bool
	Cache                 *dbcache.Cache
}

type Mutate

type Mutate struct {
	Table     string
	Where     [][]interface{}
	Mutations [][]interface{}
}

type Select

type Select struct {
	Table   string
	Columns []string
	Where   [][]interface{}
}

type Transact

type Transact []ActionResponse

type Transaction

type Transaction struct {
	OVSDB      iOVSDB
	Schema     string
	Actions    []interface{}
	Tables     map[string]string
	References map[string][]interface{}
	Counter    int
	// contains filtered or unexported fields
}

Transaction handle structure

func (*Transaction) Cancel

func (txn *Transaction) Cancel()

func (*Transaction) Commit

func (txn *Transaction) Commit() (Transact, error, bool)

Commit stores all staged changes in DB. It manages references in main table automatically.

func (*Transaction) Delete

func (txn *Transaction) Delete(d Delete)

func (*Transaction) DeleteReferences

func (txn *Transaction) DeleteReferences(dr DeleteReferences) *Transaction

func (*Transaction) Insert

func (txn *Transaction) Insert(i Insert) string

func (*Transaction) InsertReferences

func (txn *Transaction) InsertReferences(ir InsertReferences) *Transaction

func (*Transaction) Mutate

func (txn *Transaction) Mutate(m Mutate)

func (*Transaction) Select

func (txn *Transaction) Select(s Select)

func (*Transaction) Update

func (txn *Transaction) Update(u Update)

func (*Transaction) Wait

func (txn *Transaction) Wait(w Wait)

type UUID

type UUID []string

type Update

type Update struct {
	Table    string
	Where    [][]interface{}
	Row      map[string]interface{}
	WaitRows []interface{}
}

type Wait

type Wait struct {
	Timeout uint64
	Table   string
	Where   [][]interface{}
	Columns []string
	Until   string
	Rows    []interface{}
}

Jump to

Keyboard shortcuts

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