database

package
v0.0.0-...-04092ee Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenUUID

func GenUUID() string

func GetAddrPort

func GetAddrPort(conn string) (string, int)

func HasPrefix

func HasPrefix(value string, index int, dest string) bool

func PrintError

func PrintError(result []ovsdb.OperationResult)

Types

type DBClient

type DBClient struct {
	Server   string
	Database string
	Verbose  bool
	Client   *OvSDB
}
var Conf *DBClient

func NewClient

func NewClient(handler *cache.EventHandlerFuncs) (*DBClient, error)

func NewConfClient

func NewConfClient(handler *cache.EventHandlerFuncs) (*DBClient, error)

func (*DBClient) Context

func (c *DBClient) Context() context.Context

func (*DBClient) NilLog

func (c *DBClient) NilLog() *logr.Logger

func (*DBClient) Open

func (c *DBClient) Open(handler *cache.EventHandlerFuncs, block func(val *DBClient)) error

type NameCache

type NameCache struct {
	UUID     string `ovsdb:"_uuid" json:"uuid"`
	Name     string `ovsdb:"name" json:"name"`
	Address  string `ovsdb:"address" json:"address"`
	UpdateAt string `ovsdb:"update_at" json:"update_at"`
}

type OpenVPN

type OpenVPN struct {
	UUID     string `ovsdb:"_uuid" json:"uuid"`
	Protocol string `ovsdb:"protocol" json:"protocol"`
	Listen   int    `ovsdb:"listen" json:"listen"`
}

type OvSDB

type OvSDB struct {
	client.Client
	Ops []ovsdb.Operation
}
var Client *OvSDB

func (*OvSDB) Commit

func (o *OvSDB) Commit() ([]ovsdb.OperationResult, error)

func (*OvSDB) Context

func (o *OvSDB) Context() context.Context

func (*OvSDB) Execute

func (o *OvSDB) Execute(ops []ovsdb.Operation)

func (*OvSDB) Get

func (o *OvSDB) Get(m model.Model) error

func (*OvSDB) List

func (o *OvSDB) List(result interface{}) error

func (*OvSDB) Switch

func (o *OvSDB) Switch() (*Switch, error)

func (*OvSDB) Transact

func (o *OvSDB) Transact(ops ...ovsdb.Operation) ([]ovsdb.OperationResult, error)

func (*OvSDB) WhereList

func (o *OvSDB) WhereList(predict interface{}, result interface{}) error

type PrefixRoute

type PrefixRoute struct {
	UUID    string `ovsdb:"_uuid" json:"uuid"`
	Network string `ovsdb:"network" json:"network"`
	Prefix  string `ovsdb:"prefix" json:"prefix"`
	Source  string `ovsdb:"source" json:"source"`
	Gateway string `ovsdb:"gateway" json:"gateway"`
	Mode    string `ovsdb:"mode" json:"mode"`
}

type Switch

type Switch struct {
	UUID            string            `ovsdb:"_uuid" json:"uuid"`
	Protocol        string            `ovsdb:"protocol" json:"protocol"`
	Listen          int               `ovsdb:"listen" json:"listen"`
	OtherConfig     map[string]string `ovsdb:"other_config" json:"other_config"`
	VirtualNetworks []string          `ovsdb:"virtual_networks" json:"virtual_networks"`
}
type VirtualLink struct {
	UUID           string            `ovsdb:"_uuid" json:"uuid"`
	Network        string            `ovsdb:"network" json:"network"`
	Connection     string            `ovsdb:"connection" json:"connection"`
	Device         string            `ovsdb:"device" json:"device"`
	OtherConfig    map[string]string `ovsdb:"other_config" json:"other_config"`
	Authentication map[string]string `ovsdb:"authentication" json:"authentication"`
	LinkState      string            `ovsdb:"link_state" json:"link_state"`
	Status         map[string]string `ovsdb:"status" json:"status"`
}

func (*VirtualLink) IsUdpIn

func (l *VirtualLink) IsUdpIn() bool

func (*VirtualLink) Spi

func (l *VirtualLink) Spi() uint32

type VirtualNetwork

type VirtualNetwork struct {
	UUID         string            `ovsdb:"_uuid" json:"uuid"`
	Name         string            `ovsdb:"name" json:"name"`
	Provider     string            `ovsdb:"provider" json:"provider"`
	Bridge       string            `ovsdb:"bridge" json:"bridge"`
	Address      string            `ovsdb:"address" json:"address"`
	OtherConfig  map[string]string `ovsdb:"other_config" json:"other_config"`
	RemoteLinks  []string          `ovsdb:"remote_links" json:"remote_links"`
	LocalLinks   []string          `ovsdb:"local_links" json:"local_links"`
	OpenVPN      *string           `ovsdb:"open_vpn" json:"open_vpn"`
	PrefixRoutes []string          `ovsdb:"prefix_routes" json:"prefix_routes"`
}

Jump to

Keyboard shortcuts

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