db

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplDB

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

func (*ApplDB) ExistPortInitDone

func (d *ApplDB) ExistPortInitDone(ctx context.Context) (bool, error)

type AsicDB

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

func (*AsicDB) ExistBridgePort

func (d *AsicDB) ExistBridgePort(ctx context.Context, bridgePort OID) (bool, error)

func (*AsicDB) ExistRouterInterface

func (d *AsicDB) ExistRouterInterface(ctx context.Context, rif OID) (bool, error)

func (*AsicDB) GetPortIdBridgePortMap

func (d *AsicDB) GetPortIdBridgePortMap(ctx context.Context) (map[OID]OID, error)

func (*AsicDB) InFecModeRs

func (d *AsicDB) InFecModeRs(ctx context.Context, port OID) (bool, error)

type Client

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

func NewClient

func NewClient(addr string, id int, sep string) *Client

func (*Client) Del

func (c *Client) Del(ctx context.Context, key Key) error

func (*Client) Exists

func (c *Client) Exists(ctx context.Context, key Key) (bool, error)

func (*Client) GetTable

func (c *Client) GetTable(table Key) *Table

func (*Client) GetView

func (c *Client) GetView(ctx context.Context, table string) (View, error)

func (*Client) HGet

func (c *Client) HGet(ctx context.Context, key Key, field string) (string, error)

func (*Client) HGetAll

func (c *Client) HGetAll(ctx context.Context, key Key) (Val, error)

func (*Client) HSet

func (c *Client) HSet(ctx context.Context, key Key, val Val) error

func (*Client) Keys

func (c *Client) Keys(ctx context.Context, pattern Key) ([]Key, error)

type Config

type Config struct {
	Databases map[string]database `json:"DATABASES"`
	Instances map[string]instance `json:"INSTANCES"`
}

type ConfigDB

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

func (*ConfigDB) AreNeighborsSuppressed

func (d *ConfigDB) AreNeighborsSuppressed(ctx context.Context, vid uint16) (bool, error)

func (*ConfigDB) CreateVlan

func (d *ConfigDB) CreateVlan(ctx context.Context, vid uint16) error

func (*ConfigDB) CreateVlanInterface

func (d *ConfigDB) CreateVlanInterface(ctx context.Context, vid uint16, vrf string) error

func (*ConfigDB) CreateVrf

func (d *ConfigDB) CreateVrf(ctx context.Context, vrf string) error

func (*ConfigDB) CreateVxlanTunnelMap

func (d *ConfigDB) CreateVxlanTunnelMap(ctx context.Context, vid uint16, vni uint32) error

func (*ConfigDB) DeleteInterfaceConfiguration

func (d *ConfigDB) DeleteInterfaceConfiguration(ctx context.Context, interfaceName string) error

func (*ConfigDB) DeleteVlanMember

func (d *ConfigDB) DeleteVlanMember(ctx context.Context, interfaceName, vlan string) error

func (*ConfigDB) EnableLinkLocalOnly

func (d *ConfigDB) EnableLinkLocalOnly(ctx context.Context, interfaceName string) error

func (*ConfigDB) ExistVlan

func (d *ConfigDB) ExistVlan(ctx context.Context, vid uint16) (bool, error)

func (*ConfigDB) ExistVlanInterface

func (d *ConfigDB) ExistVlanInterface(ctx context.Context, vid uint16) (bool, error)

func (*ConfigDB) ExistVrf

func (d *ConfigDB) ExistVrf(ctx context.Context, vrf string) (bool, error)

func (*ConfigDB) ExistVxlanTunnelMap

func (d *ConfigDB) ExistVxlanTunnelMap(ctx context.Context, vid uint16, vni uint32) (bool, error)

func (*ConfigDB) GetPort

func (d *ConfigDB) GetPort(ctx context.Context, interfaceName string) (*Port, error)

func (*ConfigDB) GetVlanMembership

func (d *ConfigDB) GetVlanMembership(ctx context.Context, interfaceName string) ([]string, error)

func (*ConfigDB) GetVrfMembership

func (d *ConfigDB) GetVrfMembership(ctx context.Context, interfaceName string) (string, error)

func (*ConfigDB) IsLinkLocalOnly

func (d *ConfigDB) IsLinkLocalOnly(ctx context.Context, interfaceName string) (bool, error)

func (*ConfigDB) SetPortFecMode

func (d *ConfigDB) SetPortFecMode(ctx context.Context, interfaceName string, isFecRs bool) error

func (*ConfigDB) SetPortMtu

func (d *ConfigDB) SetPortMtu(ctx context.Context, interfaceName string, val string) error

func (*ConfigDB) SetVlanMember

func (d *ConfigDB) SetVlanMember(ctx context.Context, interfaceName, vlan string) error

func (*ConfigDB) SetVrfMember

func (d *ConfigDB) SetVrfMember(ctx context.Context, interfaceName string, vrf string) error

func (*ConfigDB) SuppressNeighbors

func (d *ConfigDB) SuppressNeighbors(ctx context.Context, vid uint16) error

type CountersDB

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

func (*CountersDB) GetPortNameMap

func (d *CountersDB) GetPortNameMap(ctx context.Context) (map[string]OID, error)

func (*CountersDB) GetRifNameMap

func (d *CountersDB) GetRifNameMap(ctx context.Context) (map[string]OID, error)

type DB

type DB struct {
	Appl     *ApplDB
	Asic     *AsicDB
	Config   *ConfigDB
	Counters *CountersDB
}

func New

func New(cfg *Config) *DB

type Key

type Key []string

type OID

type OID string

type Port

type Port struct {
	Mtu   string
	FecRs bool
}

type Table

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

func (*Table) Del

func (t *Table) Del(ctx context.Context, item string) error

func (*Table) Exists

func (t *Table) Exists(ctx context.Context, item string) (bool, error)

func (*Table) GetView

func (t *Table) GetView(ctx context.Context) (View, error)

func (*Table) HGet

func (t *Table) HGet(ctx context.Context, item string, field string) (string, error)

func (*Table) HGetAll

func (t *Table) HGetAll(ctx context.Context, item string) (Val, error)

func (*Table) HSet

func (t *Table) HSet(ctx context.Context, item string, val Val) error

type Val

type Val map[string]string

type View

type View map[string]struct{}

func NewView

func NewView(size int) View

func (View) Add

func (v View) Add(item string)

func (View) Has

func (v View) Has(item string) bool

func (View) Remove

func (v View) Remove(item string)

Jump to

Keyboard shortcuts

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