node

package
v0.0.0-...-102eb4e Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name string `json:"name"`
	Oid  string `json:"oid"`
}

type Config

type Config struct {
	SQLConnectionString string

	// The name of this node
	Name string

	// If true, a dataset can be checked out multiple times by the same client
	AllowMultipleCheckouts bool

	// Port used by the HTTP server
	Port int

	// Interval that defines when the synchronization procedure will run
	SyncInterval time.Duration

	// Hostname used by the HTTP server
	HostName string
}

type DatasetIndexingOptions

type DatasetIndexingOptions struct {
	AllowMultipleCheckouts bool
}

type NodeCore

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

TODO: refine storage of data. Ie: use database as the secondary storage with in-memory maps as the primary storage. Use retention policy to flush the caches to disk/db? Only flush deltas to disk/db to reduce data transfer

func NewNodeCore

func NewNodeCore(cm certManager, gossipObs gossipObserver, dsManager datasetManager, stateSync stateSyncer, dcManager datasetCheckoutManager, config *Config) (*NodeCore, error)

TODO: reload dateapplied and datecreated from the databases on boot time.

func (*NodeCore) DatasetIsCheckedOut

func (n *NodeCore) DatasetIsCheckedOut(datasetId string, client *pb.Client) (bool, error)

func (*NodeCore) HandshakeDirectoryServer

func (n *NodeCore) HandshakeDirectoryServer(addr string) error

func (*NodeCore) HandshakePolicyStore

func (n *NodeCore) HandshakePolicyStore(addr string) error

func (*NodeCore) IfritAddress

func (n *NodeCore) IfritAddress() string

func (*NodeCore) IfritClient

func (n *NodeCore) IfritClient() *ifrit.Client

TODO: restore checkouts from previous runs so that we don't lose information from memory. Especially for checkout datasets

func (*NodeCore) IndexDataset

func (n *NodeCore) IndexDataset(datasetId string, indexOptions *DatasetIndexingOptions) error

RequestPolicy requests policies from policy store that are assigned to the dataset given by the id. It will also populate the node's database with the available identifiers and assoicate them with policies. You will have to call this method to make the datasets available to the clients.

func (*NodeCore) Name

func (n *NodeCore) Name() string

func (*NodeCore) RegisterDatasetHandler

func (n *NodeCore) RegisterDatasetHandler(f clientRequestHandler)

Registers the given handler when a compressed archive is fetched from a remote source.

func (*NodeCore) RegisterMetadataHandler

func (n *NodeCore) RegisterMetadataHandler(f clientRequestHandler)

Registers the given handler when external metadata is requested.

func (*NodeCore) RemoveDataset

func (n *NodeCore) RemoveDataset(id string)

Removes the dataset policy from the node. The dataset will no longer be available to clients.

func (*NodeCore) Shutdown

func (n *NodeCore) Shutdown()

Shuts down the node

func (*NodeCore) Start

func (n *NodeCore) Start()

func (*NodeCore) String

func (n *NodeCore) String() string

Returns the string representation of the node.

Jump to

Keyboard shortcuts

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