server

package
v0.0.0-...-6f410cc Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomId

func RandomId(ctx context.Context) (id string, err error)

Types

type ComputeParams

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

type Core

type Core struct {
	StoredTrustMatrices NamedTrustMatrices
	StoredTrustVectors  NamedTrustVectors
	// contains filtered or unexported fields
}

func NewCore

func NewCore(ctx context.Context) (*Core, error)

func (*Core) LoadS3Object

func (server *Core) LoadS3Object(
	ctx context.Context, bucket string, key string,
) (*s3.GetObjectOutput, error)

type HTTPError

type HTTPError struct {
	Code  int
	Inner error
}

func (HTTPError) Error

func (e HTTPError) Error() string

type JobSpec

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

type NamedTrustMatrices

type NamedTrustMatrices struct {
	util.SyncMap[string, *TrustMatrix]
}

func (*NamedTrustMatrices) Delete

func (ntms *NamedTrustMatrices) Delete(id string) (deleted bool)

func (*NamedTrustMatrices) Merge

func (ntms *NamedTrustMatrices) Merge(
	id string, c *sparse.Matrix,
) (tm2 *TrustMatrix, created bool)

Merge merges c into the stored local trust. It takes ownership of c; caller must not use c anymore.

func (*NamedTrustMatrices) New

func (ntms *NamedTrustMatrices) New(ctx context.Context) (
	id string, err error,
)

New creates and stores an empty matrix under a random name.

func (*NamedTrustMatrices) NewNamed

func (ntms *NamedTrustMatrices) NewNamed(id string) error

NewNamed creates and stores an empty vector under the given name.

func (*NamedTrustMatrices) Set

func (ntms *NamedTrustMatrices) Set(
	id string, c *sparse.Matrix,
) (tm *TrustMatrix, created bool)

Set stores c into the stored local trust. It takes ownership of c; caller must not use c anymore.

type NamedTrustVectors

type NamedTrustVectors struct {
	util.SyncMap[string, *TrustVector]
}

func (*NamedTrustVectors) Delete

func (ntvs *NamedTrustVectors) Delete(id string) (deleted bool)

func (*NamedTrustVectors) Merge

func (ntvs *NamedTrustVectors) Merge(
	id string, v *sparse.Vector,
) (tv2 *TrustVector, created bool)

Merge merges v into the stored local trust. It takes ownership of v; caller must not use v anymore.

func (*NamedTrustVectors) New

func (ntvs *NamedTrustVectors) New(ctx context.Context) (id string, err error)

New creates and stores an empty vector under a random name.

func (*NamedTrustVectors) NewNamed

func (ntvs *NamedTrustVectors) NewNamed(id string) error

NewNamed creates and stores an empty vector under the given name.

func (*NamedTrustVectors) Set

func (ntvs *NamedTrustVectors) Set(
	id string, v *sparse.Vector,
) (tv *TrustVector, created bool)

Set stores v into the stored local trust. It takes ownership of v; caller must not use v anymore.

type PeriodicJob

type PeriodicJob struct {
}

type TrustMatrix

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

func NewTrustMatrix

func NewTrustMatrix() *TrustMatrix

func NewTrustMatrixWithContents

func NewTrustMatrixWithContents(c *sparse.Matrix) *TrustMatrix

func (*TrustMatrix) LockAndRun

func (m *TrustMatrix) LockAndRun(
	f func(matrix *sparse.Matrix, timestamp *big.Int) error,
) error

type TrustVector

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

func NewTrustVector

func NewTrustVector() *TrustVector

func NewTrustVectorWithContents

func NewTrustVectorWithContents(c *sparse.Vector) *TrustVector

func (*TrustVector) LockAndRun

func (m *TrustVector) LockAndRun(
	f func(vector *sparse.Vector, timestamp *big.Int) error,
) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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