dbparse

package
v0.0.0-...-9c779f9 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBRead

func DBRead(filename string) (OVNDbType, *OVSdbSchema, error)

func DBReadWithSchema

func DBReadWithSchema(in io.Reader, maxTokenSize int, ovsSchema *OVSdbSchema) (OVNDbType, *OVSdbSchema, error)

Types

type CType

type CType int
const (
	Atomic CType = iota
	Map
	Set
)

type DbDef

type DbDef struct {
	Schema    *OVSdbSchema
	Name      string
	TableDefs []TableDef
}

func (*DbDef) AugmentSchema

func (tbl *DbDef) AugmentSchema() error

func (*DbDef) ParseSchema

func (db *DbDef) ParseSchema(tbl *OVSdbSchema) error

type OVNDbType

type OVNDbType interface {
	IsValid() bool
}

func DBReadBuf

func DBReadBuf(buf bytes.Buffer, ovsSchema *OVSdbSchema) (OVNDbType, error)

type OVSDBType

type OVSDBType int

TaskState represents the state of task, moving through Created, Running then Finished or Errorred

const (
	Unknown OVSDBType = iota
	// Created represents the task has been created but not started yet
	NB
	//Running represents the task has started
	SB
)

func (OVSDBType) Filename

func (s OVSDBType) Filename() string

func (OVSDBType) MarshalJSON

func (s OVSDBType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (OVSDBType) Postfix

func (s OVSDBType) Postfix() string

func (OVSDBType) String

func (s OVSDBType) String() string

func (*OVSDBType) UnmarshalJSON

func (s *OVSDBType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type OVSdbSchema

type OVSdbSchema struct {
	ChkSum  string                 `json:"cksum"`
	Type    OVSDBType              `json:"name"`
	Version string                 `json:"version"`
	Tables  map[string]interface{} `json:"tables"`
}

func (*OVSdbSchema) NewDb

func (schema *OVSdbSchema) NewDb() (OVNDbType, error)

func (*OVSdbSchema) ReadOvsDbSchema

func (schema *OVSdbSchema) ReadOvsDbSchema(in io.Reader, maxTokenSize int) error

func (*OVSdbSchema) ReadOvsDbSchemaBuf

func (schema *OVSdbSchema) ReadOvsDbSchemaBuf(buf bytes.Buffer) error

func (*OVSdbSchema) ReadOvsDbSchemaFile

func (schema *OVSdbSchema) ReadOvsDbSchemaFile(filename string) error

type TableCol

type TableCol struct {
	Name      string
	Type      string
	JsonName  string
	Optional  bool
	Ephemeral bool
	Index     bool
	Comment   string
	RefTable  string
	Range     []int
}

type TableDef

type TableDef struct {
	Name     string
	JsonName string
	Columns  []TableCol
	Indices  map[string]bool
	ToolTip  string
}

Jump to

Keyboard shortcuts

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