vid

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateVidTable = `` /* 260-byte string literal not displayed */

Functions

func InitDb

func InitDb(pgConn string) (db *sql.DB, err error)

Types

type DbInterface

type DbInterface interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	Query(query string, args ...interface{}) (*sql.Rows, error)
}

type Vid

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

func New

func New(pgConn string) (vid *Vid, err error)

func (*Vid) GetDeploymentId

func (this *Vid) GetDeploymentId(vid string) (deploymentId string, exists bool, err error)

returns deploymentId related to vid

func (*Vid) GetRelations

func (this *Vid) GetRelations() (byVid map[string]string, byDeploymentId map[string]string, err error)

func (*Vid) GetVirtualId

func (this *Vid) GetVirtualId(deploymentId string) (vid string, exists bool, err error)

returns vid related to deploymentId

func (*Vid) RemoveVidRelation

func (this *Vid) RemoveVidRelation(vid string, deploymentId string) (commit func() error, rollback func() error, err error)

remove relation between vid (command.Id) and deploymentId

func (*Vid) SaveVidRelation

func (this *Vid) SaveVidRelation(vid string, deploymentId string) (err error)

saves relation between vid (command.Id) and deploymentId

func (*Vid) SetVid

func (this *Vid) SetVid(element VidUpdateable) (err error)

replaces deployment ids in element with vid from database

func (*Vid) VidExists

func (this *Vid) VidExists(vid string) (exists bool, err error)

type VidUpdateable

type VidUpdateable interface {
	SetDeploymentId(id string)
	GetDeploymentId() (id string)
}

Jump to

Keyboard shortcuts

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