repo

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdRepo = &cobra.Command{
	Use:     "repo CONFIG-FILE",
	Short:   "Named Data Networking Data Repository",
	GroupID: "run",
	Version: utils.NDNdVersion,
	Args:    cobra.ExactArgs(1),
	Run:     run,
}

Functions

This section is empty.

Types

type Config

type Config struct {
	// Name is the name of the repo service.
	Name string `json:"name"`
	// StorageDir is the directory to store data.
	StorageDir string `json:"storage_dir"`
	// URI specifying KeyChain location.
	KeyChainUri string `json:"keychain"`
	// List of trust anchor full names.
	TrustAnchors []string `json:"trust_anchors"`
	// IgnoreValidity skips validity period checks when fetching remote data (e.g. SVS snapshots).
	IgnoreValidity bool `json:"ignore_validity"`

	// NameN is the parsed name of the repo service.
	NameN enc.Name
}

func DefaultConfig

func DefaultConfig() *Config

(AI GENERATED DESCRIPTION): Returns a new Config with default placeholder values: empty Name and StorageDir strings, and a nil NameN slice.

func (*Config) Parse

func (c *Config) Parse() (err error)

(AI GENERATED DESCRIPTION): Parses the configuration by validating the repository name, ensuring a storage directory is specified, converting it to an absolute path, and creating the directory if necessary.

func (*Config) TrustAnchorNames

func (c *Config) TrustAnchorNames() []enc.Name

(AI GENERATED DESCRIPTION): Returns the trust‑anchor names stored in the Config as parsed enc.Name objects, panicking if any string cannot be parsed.

type Repo

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

func NewRepo

func NewRepo(config *Config) *Repo

(AI GENERATED DESCRIPTION): Creates a new Repo instance, initializing it with the supplied configuration and an empty map for its groupsSvs.

func (*Repo) Start

func (r *Repo) Start() (err error)

(AI GENERATED DESCRIPTION): Initializes and starts the NDN data repository by setting up storage, network engine, keychain, trust configuration, and object client, then attaching the management command handler and announcing its prefix.

func (*Repo) Stop

func (r *Repo) Stop() error

(AI GENERATED DESCRIPTION): Stops the NDN data repository by halting all service groups, deregistering its prefix, detaching the command handler, and stopping the underlying client and engine.

func (*Repo) String

func (r *Repo) String() string

(AI GENERATED DESCRIPTION): Returns the string `"repo"` as the string representation of a `Repo` instance.

type RepoSvs

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

func NewRepoSvs

func NewRepoSvs(config *Config, client ndn.Client, cmd *tlv.SyncJoin) *RepoSvs

(AI GENERATED DESCRIPTION): Creates a new `RepoSvs` instance initialized with the given configuration, NDN client, and SyncJoin command.

func (*RepoSvs) Start

func (r *RepoSvs) Start() (err error)

(AI GENERATED DESCRIPTION): Initializes and starts the repository SVS ALO, configuring snapshots, multicast, prefix announcements, and publisher subscriptions.

func (*RepoSvs) Stop

func (r *RepoSvs) Stop() (err error)

(AI GENERATED DESCRIPTION): Stops the repository’s SVS service by withdrawing its group and optional multicast prefixes from the NDN client and stopping the underlying SVS ALO component.

func (*RepoSvs) String

func (r *RepoSvs) String() string

(AI GENERATED DESCRIPTION): Generates a human‑readable string identifying the repo‑svs instance, displaying its associated group name.

Directories

Path Synopsis
Code generated by ndn tlv codegen DO NOT EDIT.
Code generated by ndn tlv codegen DO NOT EDIT.

Jump to

Keyboard shortcuts

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