segment

package
v0.0.0-...-9250cc1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEd25519Unavailable = errors.New("the Ed25519 is not available as GPU is not enabled")
View Source
var GPUHasBeenInitialized = false

Functions

func AssertCommand

func AssertCommand(t Helper, s *Segment, name string, args ...string)

func AssertCommandFailure

func AssertCommandFailure(t *testing.T, s *Segment, name string, args []string, errorString string)

func AssertCommandResponse

func AssertCommandResponse(t *testing.T, s *Segment, name string, args []string, expected string)

func AssertEd25519ArrayEmpty

func AssertEd25519ArrayEmpty(t *testing.T, s *Segment, h variables.Handle)

func AssertEd25519ArrayNotEmpty

func AssertEd25519ArrayNotEmpty(t *testing.T, s *Segment, h variables.Handle)

func AssertNoVariable

func AssertNoVariable(t *testing.T, s *Segment, h variables.Handle)

func AssertValue

func AssertValue[T types.TypeVal](t *testing.T, s *Segment, h variables.Handle, v T)

func AssertValueNot

func AssertValueNot[T types.TypeVal](t *testing.T, s *Segment, h variables.Handle, v T)

func AssertVariable

func AssertVariable[T types.TypeVal](t *testing.T, s *Segment, h variables.Handle) T

func CreateTmpTable

func CreateTmpTable(q string) (*sql.DB, error)

func IsEd25519ArrayEmpty

func IsEd25519ArrayEmpty(t *testing.T, s *Segment, h variables.Handle) bool

func PrintVariableStore

func PrintVariableStore(t *testing.T, s *Segment)

PrintVariableStore will print the contents of the variable store after the test assertions have run. This function is useful when you have a failing test and want to see the variable store contents.

func StrToByteSlice

func StrToByteSlice(str string, size int) []byte

Types

type CommandTiming

type CommandTiming struct {
	Name      string
	StartTime time.Time
	EndTime   time.Time
}

type Helper

type Helper interface {
	Helper()
	Fatal(args ...any)
}

type Options

type Options struct {
	NodeIDString           string
	NodeName               string
	RabbitMQAddr           string
	RabbitMQIncomingPrefix string
	RabbitMQOutgoingPrefix string
	Address                string
	ExternalAddress        string
	ExternalPort           int
	ExternalFQDN           string
	EnableGPU              bool
	DbChunkSize            int
}

type Segment

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

func NewSegment

func NewSegment(options Options, dbType string, dbConnStr string) (*Segment, error)

func NewTestSegment

func NewTestSegment() *Segment

func (*Segment) ClearTimingInformation

func (s *Segment) ClearTimingInformation()

func (*Segment) DBConnectionString

func (s *Segment) DBConnectionString() string

func (*Segment) DBType

func (s *Segment) DBType() string

func (*Segment) DeleteFromPickleTable

func (s *Segment) DeleteFromPickleTable(destination string) error

func (*Segment) DeleteVariable

func (s *Segment) DeleteVariable(h variables.Handle)

func (*Segment) GetPeerAddress

func (s *Segment) GetPeerAddress(nodeID string) string

func (*Segment) GetTimingInformation

func (s *Segment) GetTimingInformation() []commands.Timing

func (*Segment) GetVariable

func (s *Segment) GetVariable(h variables.Handle) (types.TypeVal, error)

func (*Segment) IsGPUAvailable

func (s *Segment) IsGPUAvailable() bool

func (*Segment) Listen

func (s *Segment) Listen() error

func (*Segment) LoadDestination

func (s *Segment) LoadDestination() string

func (*Segment) LoadFromPickleTable

func (s *Segment) LoadFromPickleTable(h variables.Handle) ([]variables.Pickle, error)

func (*Segment) Log

func (s *Segment) Log(format string, args ...any)

func (*Segment) Node

func (s *Segment) Node() *types.Node

func (*Segment) Register

func (s *Segment) Register(name string, f commands.CommandFunc)

func (*Segment) RequestTransferBytes

func (s *Segment) RequestTransferBytes(nodeAddress string, handle string, newHandle string, dtype string, opcode string) error

func (*Segment) RunCommand

func (s *Segment) RunCommand(name string, args []string) (resp string, err error)

func (*Segment) RunCommandWithLogging

func (s *Segment) RunCommandWithLogging(name string, args []string, responseRequired bool) (resp string)

func (*Segment) SaveDestination

func (s *Segment) SaveDestination() string

func (*Segment) SaveToPickleTable

func (s *Segment) SaveToPickleTable(t types.TypeCode, h variables.Handle, opcode string, elementindex int, b []byte) error

func (*Segment) SegmentNodes

func (s *Segment) SegmentNodes() map[string]string

func (*Segment) SetLoadDestination

func (s *Segment) SetLoadDestination(v string)

func (*Segment) SetPeerAddress

func (s *Segment) SetPeerAddress(nodeID string, addr string)

func (*Segment) SetSaveDestination

func (s *Segment) SetSaveDestination(v string)

func (*Segment) SetVariable

func (s *Segment) SetVariable(h variables.Handle, value types.TypeVal)

func (*Segment) StartHTTPServer

func (s *Segment) StartHTTPServer() bool

func (*Segment) TransferBytes

func (s *Segment) TransferBytes(nodeAddress string, handle string, newHandle string, dtype string, opcode string) error

func (*Segment) Variables

func (s *Segment) Variables() variables.Store

Directories

Path Synopsis
net

Jump to

Keyboard shortcuts

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