server

package
v0.0.0-...-f0bc3ce Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package server provides an alpha-quality implementation of an OVSDB Server

It is designed only to be used for testing the functionality of the client library such that assertions can be made on the cache that backs the client's monitor or the server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OvsdbServer

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

OvsdbServer is an ovsdb server

func NewOvsdbServer

func NewOvsdbServer(db database.Database, models ...model.DatabaseModel) (*OvsdbServer, error)

NewOvsdbServer returns a new OvsdbServer

func (*OvsdbServer) Cancel

func (o *OvsdbServer) Cancel(client *rpc2.Client, args []interface{}, reply *[]interface{}) error

Cancel cancels the last transaction

func (*OvsdbServer) Close

func (o *OvsdbServer) Close()

Close closes the OvsdbServer

func (*OvsdbServer) DoEcho

func (o *OvsdbServer) DoEcho(ok bool)

func (*OvsdbServer) Echo

func (o *OvsdbServer) Echo(client *rpc2.Client, args []interface{}, reply *[]interface{}) error

Echo tests the liveness of the connection

func (*OvsdbServer) GetSchema

func (o *OvsdbServer) GetSchema(client *rpc2.Client, args []interface{}, reply *ovsdb.DatabaseSchema,
) error

func (*OvsdbServer) ListDatabases

func (o *OvsdbServer) ListDatabases(client *rpc2.Client, args []interface{}, reply *[]string) error

ListDatabases lists the databases in the current system

func (*OvsdbServer) Lock

func (o *OvsdbServer) Lock(client *rpc2.Client, args []interface{}, reply *[]interface{}) error

Lock acquires a lock on a table for a the client

func (*OvsdbServer) Monitor

func (o *OvsdbServer) Monitor(client *rpc2.Client, args []json.RawMessage, reply *ovsdb.TableUpdates) error

Monitor monitors a given database table and provides updates to the client via an RPC callback

func (*OvsdbServer) MonitorCancel

func (o *OvsdbServer) MonitorCancel(client *rpc2.Client, args []interface{}, reply *[]interface{}) error

MonitorCancel cancels a monitor on a given table

func (*OvsdbServer) MonitorCond

func (o *OvsdbServer) MonitorCond(client *rpc2.Client, args []json.RawMessage, reply *ovsdb.TableUpdates2) error

MonitorCond monitors a given database table and provides updates to the client via an RPC callback

func (*OvsdbServer) MonitorCondSince

func (o *OvsdbServer) MonitorCondSince(client *rpc2.Client, args []json.RawMessage, reply *ovsdb.MonitorCondSinceReply) error

MonitorCondSince monitors a given database table and provides updates to the client via an RPC callback

func (*OvsdbServer) OnConnect

func (o *OvsdbServer) OnConnect(f func(*rpc2.Client))

OnConnect registers a function to run when a client connects.

func (*OvsdbServer) OnDisConnect

func (o *OvsdbServer) OnDisConnect(f func(*rpc2.Client))

OnDisConnect registers a function to run when a client disconnects.

func (*OvsdbServer) Ready

func (o *OvsdbServer) Ready() bool

Ready returns true if a server is ready to handle connections

func (*OvsdbServer) Serve

func (o *OvsdbServer) Serve(protocol string, path string) error

Serve starts the OVSDB server on the given path and protocol

func (*OvsdbServer) Steal

func (o *OvsdbServer) Steal(client *rpc2.Client, args []interface{}, reply *[]interface{}) error

Steal steals a lock for a client

func (*OvsdbServer) Transact

func (o *OvsdbServer) Transact(client *rpc2.Client, args []json.RawMessage, reply *[]*ovsdb.OperationResult) error

Transact issues a new database transaction and returns the results

func (*OvsdbServer) Unlock

func (o *OvsdbServer) Unlock(client *rpc2.Client, args []interface{}, reply *[]interface{}) error

Unlock releases a lock for a client

Jump to

Keyboard shortcuts

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