sqlite

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeserializeContext

func DeserializeContext(context string) map[string]string

func DeserializeIPs

func DeserializeIPs(ips string) []string

func DeserializeStatus

func DeserializeStatus(status int32) nspAPI.Target_Status

func DeserializeType

func DeserializeType(t int32) nspAPI.Target_Type

func GetTargetID

func GetTargetID(target *nspAPI.Target) string

func SQLTConduitToNSPConduit

func SQLTConduitToNSPConduit(conduit *Conduit) *nspAPI.Conduit

func SQLTStreamToNSPStream

func SQLTStreamToNSPStream(stream *Stream) *nspAPI.Stream

func SQLTTrenchToNSPTrench

func SQLTTrenchToNSPTrench(trench *Trench) *nspAPI.Trench

func SQLTargetToNSPTarget

func SQLTargetToNSPTarget(target *Target) *nspAPI.Target

func SerializeContext

func SerializeContext(context map[string]string) string

func SerializeIPs

func SerializeIPs(ips []string) string

func SerializeStatus

func SerializeStatus(status nspAPI.Target_Status) int32

func SerializeType

func SerializeType(t nspAPI.Target_Type) int32

Types

type Conduit

type Conduit struct {
	Name       string `gorm:"primaryKey"`
	TrenchName string
	Trench     Trench `gorm:"foreignKey:TrenchName"`
}

func NSPTConduitToSQLConduit

func NSPTConduitToSQLConduit(conduit *nspAPI.Conduit) Conduit

type Stream

type Stream struct {
	Name        string `gorm:"primaryKey"`
	ConduitName string
	Conduit     Conduit `gorm:"foreignKey:ConduitName"`
}

func NSPTStreamToSQLStream

func NSPTStreamToSQLStream(stream *nspAPI.Stream) Stream

type Target

type Target struct {
	ID         string `gorm:"primaryKey"`
	Ips        string
	Context    string
	Status     int32
	Type       int32
	StreamName string
	Stream     Stream `gorm:"foreignKey:StreamName"`
}

func NSPTargetToSQLTarget

func NSPTargetToSQLTarget(target *nspAPI.Target) *Target

type TargetRegistrySQLite

type TargetRegistrySQLite struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func New

func New(datastore string) (*TargetRegistrySQLite, error)

func (*TargetRegistrySQLite) Close added in v1.0.1

func (trsql *TargetRegistrySQLite) Close() error

func (*TargetRegistrySQLite) Get

func (trsql *TargetRegistrySQLite) Get(ctx context.Context, target *nspAPI.Target) ([]*nspAPI.Target, error)

func (*TargetRegistrySQLite) Remove

func (trsql *TargetRegistrySQLite) Remove(ctx context.Context, target *nspAPI.Target) error

func (*TargetRegistrySQLite) Set

func (trsql *TargetRegistrySQLite) Set(ctx context.Context, target *nspAPI.Target) error

func (*TargetRegistrySQLite) Watch

func (trsql *TargetRegistrySQLite) Watch(ctx context.Context, target *nspAPI.Target) (types.TargetWatcher, error)

type Trench

type Trench struct {
	Name string `gorm:"primaryKey"`
}

func NSPTTrenchToSQLTrench

func NSPTTrenchToSQLTrench(trench *nspAPI.Trench) Trench

Jump to

Keyboard shortcuts

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