run

package
v1.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 90 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualConfiguration

func EqualConfiguration(a, b Configuration) bool

EqualConfiguration is used to compare the values of the union

func EqualConsensusApp

func EqualConsensusApp(a, b ConsensusApp) bool

EqualConsensusApp is used to compare the values of the union

func EqualPrivateKey

func EqualPrivateKey(a, b PrivateKey) bool

EqualPrivateKey is used to compare the values of the union

func EqualService

func EqualService(a, b Service) bool

EqualService is used to compare the values of the union

func EqualStorage

func EqualStorage(a, b Storage) bool

EqualStorage is used to compare the values of the union

func MarshalTOML

func MarshalTOML(a any) ([]byte, error)

func Ptr

func Ptr[T any](v T) *T

Types

type BadgerStorage

type BadgerStorage struct {
	Path string `json:"path,omitempty" form:"path" query:"path" validate:"required"`
}

func (*BadgerStorage) Copy

func (v *BadgerStorage) Copy() *BadgerStorage

func (*BadgerStorage) CopyAsInterface

func (v *BadgerStorage) CopyAsInterface() interface{}

func (*BadgerStorage) Equal

func (v *BadgerStorage) Equal(u *BadgerStorage) bool

func (*BadgerStorage) MarshalJSON

func (v *BadgerStorage) MarshalJSON() ([]byte, error)

func (*BadgerStorage) Type

func (*BadgerStorage) Type() StorageType

func (*BadgerStorage) UnmarshalJSON

func (v *BadgerStorage) UnmarshalJSON(data []byte) error

type CometNodeKeyFile

type CometNodeKeyFile struct {
	Path string `json:"path,omitempty" form:"path" query:"path" validate:"required"`
	// contains filtered or unexported fields
}

func (*CometNodeKeyFile) Copy

func (*CometNodeKeyFile) CopyAsInterface

func (v *CometNodeKeyFile) CopyAsInterface() interface{}

func (*CometNodeKeyFile) Equal

func (v *CometNodeKeyFile) Equal(u *CometNodeKeyFile) bool

func (*CometNodeKeyFile) MarshalJSON

func (v *CometNodeKeyFile) MarshalJSON() ([]byte, error)

func (*CometNodeKeyFile) Type

func (*CometNodeKeyFile) UnmarshalJSON

func (v *CometNodeKeyFile) UnmarshalJSON(data []byte) error

type CometPrivValFile

type CometPrivValFile struct {
	Path string `json:"path,omitempty" form:"path" query:"path" validate:"required"`
	// contains filtered or unexported fields
}

func (*CometPrivValFile) Copy

func (*CometPrivValFile) CopyAsInterface

func (v *CometPrivValFile) CopyAsInterface() interface{}

func (*CometPrivValFile) Equal

func (v *CometPrivValFile) Equal(u *CometPrivValFile) bool

func (*CometPrivValFile) MarshalJSON

func (v *CometPrivValFile) MarshalJSON() ([]byte, error)

func (*CometPrivValFile) Type

func (*CometPrivValFile) UnmarshalJSON

func (v *CometPrivValFile) UnmarshalJSON(data []byte) error

type Config

type Config struct {
	Network         string           `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Logging         *Logging         `json:"logging,omitempty" form:"logging" query:"logging" validate:"required"`
	Instrumentation *Instrumentation `json:"instrumentation,omitempty" form:"instrumentation" query:"instrumentation" validate:"required"`
	P2P             *P2P             `json:"p2P,omitempty" form:"p2P" query:"p2P" validate:"required"`
	Configurations  []Configuration  `json:"configurations,omitempty" form:"configurations" query:"configurations" validate:"required"`
	Services        []Service        `json:"services,omitempty" form:"services" query:"services" validate:"required"`
	// contains filtered or unexported fields
}

func (*Config) Copy

func (v *Config) Copy() *Config

func (*Config) CopyAsInterface

func (v *Config) CopyAsInterface() interface{}

func (*Config) Equal

func (v *Config) Equal(u *Config) bool

func (*Config) FilePath

func (c *Config) FilePath() string

func (*Config) Load

func (c *Config) Load(b []byte, format func([]byte, any) error) error

func (*Config) LoadFrom

func (c *Config) LoadFrom(file string) error

func (*Config) Marshal

func (c *Config) Marshal(format func(any) ([]byte, error)) ([]byte, error)

func (*Config) MarshalJSON

func (v *Config) MarshalJSON() ([]byte, error)

func (*Config) Save

func (c *Config) Save() error

func (*Config) SaveTo

func (c *Config) SaveTo(file string) error

func (*Config) SetFilePath

func (c *Config) SetFilePath(p string)

func (*Config) UnmarshalJSON

func (v *Config) UnmarshalJSON(data []byte) error

type Configuration

type Configuration interface {
	Type() ConfigurationType
	CopyAsInterface() any
	// contains filtered or unexported methods
}

func CopyConfiguration

func CopyConfiguration(v Configuration) Configuration

CopyConfiguration copies a Configuration.

func NewConfiguration

func NewConfiguration(typ ConfigurationType) (Configuration, error)

NewConfiguration creates a new Configuration for the specified ConfigurationType.

func UnmarshalConfigurationJSON

func UnmarshalConfigurationJSON(data []byte) (Configuration, error)

UnmarshalConfigurationJson unmarshals a Configuration.

type ConfigurationType

type ConfigurationType int
const ConfigurationTypeCoreValidator ConfigurationType = 1

ConfigurationTypeCoreValidator .

const ConfigurationTypeDevnet ConfigurationType = 3

ConfigurationTypeDevnet .

const ConfigurationTypeGateway ConfigurationType = 2

ConfigurationTypeGateway .

func ConfigurationTypeByName

func ConfigurationTypeByName(name string) (ConfigurationType, bool)

ConfigurationTypeByName returns the named Configuration Type.

func (ConfigurationType) GetEnumValue

func (v ConfigurationType) GetEnumValue() uint64

GetEnumValue returns the value of the Configuration Type

func (ConfigurationType) MarshalJSON

func (v ConfigurationType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Configuration Type to JSON as a string.

func (*ConfigurationType) SetEnumValue

func (v *ConfigurationType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (ConfigurationType) String

func (v ConfigurationType) String() string

String returns the name of the Configuration Type.

func (*ConfigurationType) UnmarshalJSON

func (v *ConfigurationType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Configuration Type from JSON as a string.

type ConsensusApp

type ConsensusApp interface {
	Type() ConsensusAppType
	CopyAsInterface() any

	Requires() []ioc.Requirement
	Provides() []ioc.Provided
	// contains filtered or unexported methods
}

func CopyConsensusApp

func CopyConsensusApp(v ConsensusApp) ConsensusApp

CopyConsensusApp copies a ConsensusApp.

func NewConsensusApp

func NewConsensusApp(typ ConsensusAppType) (ConsensusApp, error)

NewConsensusApp creates a new ConsensusApp for the specified ConsensusAppType.

func UnmarshalConsensusAppJSON

func UnmarshalConsensusAppJSON(data []byte) (ConsensusApp, error)

UnmarshalConsensusAppJson unmarshals a ConsensusApp.

type ConsensusAppType

type ConsensusAppType int
const ConsensusAppTypeCore ConsensusAppType = 1

ConsensusAppTypeCore .

func ConsensusAppTypeByName

func ConsensusAppTypeByName(name string) (ConsensusAppType, bool)

ConsensusAppTypeByName returns the named Consensus App Type.

func (ConsensusAppType) GetEnumValue

func (v ConsensusAppType) GetEnumValue() uint64

GetEnumValue returns the value of the Consensus App Type

func (ConsensusAppType) MarshalJSON

func (v ConsensusAppType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Consensus App Type to JSON as a string.

func (*ConsensusAppType) SetEnumValue

func (v *ConsensusAppType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (ConsensusAppType) String

func (v ConsensusAppType) String() string

String returns the name of the Consensus App Type.

func (*ConsensusAppType) UnmarshalJSON

func (v *ConsensusAppType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Consensus App Type from JSON as a string.

type ConsensusService

type ConsensusService struct {
	NodeDir          string          `json:"nodeDir,omitempty" form:"nodeDir" query:"nodeDir" validate:"required"`
	ValidatorKey     PrivateKey      `json:"validatorKey,omitempty" form:"validatorKey" query:"validatorKey" validate:"required"`
	Genesis          string          `json:"genesis,omitempty" form:"genesis" query:"genesis" validate:"required"`
	Listen           p2p.Multiaddr   `json:"listen,omitempty" form:"listen" query:"listen" validate:"required"`
	BootstrapPeers   []p2p.Multiaddr `json:"bootstrapPeers,omitempty" form:"bootstrapPeers" query:"bootstrapPeers" validate:"required"`
	MetricsNamespace string          `json:"metricsNamespace,omitempty" form:"metricsNamespace" query:"metricsNamespace"`
	App              ConsensusApp    `json:"app,omitempty" form:"app" query:"app" validate:"required"`
}

func (*ConsensusService) Copy

func (*ConsensusService) CopyAsInterface

func (v *ConsensusService) CopyAsInterface() interface{}

func (*ConsensusService) Equal

func (v *ConsensusService) Equal(u *ConsensusService) bool

func (*ConsensusService) MarshalJSON

func (v *ConsensusService) MarshalJSON() ([]byte, error)

func (*ConsensusService) Provides

func (c *ConsensusService) Provides() []ioc.Provided

func (*ConsensusService) Requires

func (c *ConsensusService) Requires() []ioc.Requirement

func (*ConsensusService) Type

func (*ConsensusService) Type() ServiceType

func (*ConsensusService) UnmarshalJSON

func (v *ConsensusService) UnmarshalJSON(data []byte) error

type CoreConsensusApp

type CoreConsensusApp struct {
	Partition            *protocol.PartitionInfo `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	EnableHealing        *bool                   `json:"enableHealing,omitempty" form:"enableHealing" query:"enableHealing"`
	EnableDirectDispatch *bool                   `json:"enableDirectDispatch,omitempty" form:"enableDirectDispatch" query:"enableDirectDispatch"`
	MaxEnvelopesPerBlock *uint64                 `json:"maxEnvelopesPerBlock,omitempty" form:"maxEnvelopesPerBlock" query:"maxEnvelopesPerBlock"`
}

func (*CoreConsensusApp) Copy

func (*CoreConsensusApp) CopyAsInterface

func (v *CoreConsensusApp) CopyAsInterface() interface{}

func (*CoreConsensusApp) Equal

func (v *CoreConsensusApp) Equal(u *CoreConsensusApp) bool

func (*CoreConsensusApp) MarshalJSON

func (v *CoreConsensusApp) MarshalJSON() ([]byte, error)

func (*CoreConsensusApp) Provides

func (c *CoreConsensusApp) Provides() []ioc.Provided

func (*CoreConsensusApp) Requires

func (c *CoreConsensusApp) Requires() []ioc.Requirement

func (*CoreConsensusApp) Type

func (*CoreConsensusApp) UnmarshalJSON

func (v *CoreConsensusApp) UnmarshalJSON(data []byte) error

type CoreValidatorConfiguration

type CoreValidatorConfiguration struct {
	Listen               p2p.Multiaddr   `json:"listen,omitempty" form:"listen" query:"listen" validate:"required"`
	BVN                  string          `json:"bvn,omitempty" form:"bvn" query:"bvn" validate:"required"`
	ValidatorKey         PrivateKey      `json:"validatorKey,omitempty" form:"validatorKey" query:"validatorKey" validate:"required"`
	DnGenesis            string          `json:"dnGenesis,omitempty" form:"dnGenesis" query:"dnGenesis" validate:"required"`
	BvnGenesis           string          `json:"bvnGenesis,omitempty" form:"bvnGenesis" query:"bvnGenesis" validate:"required"`
	DnBootstrapPeers     []p2p.Multiaddr `json:"dnBootstrapPeers,omitempty" form:"dnBootstrapPeers" query:"dnBootstrapPeers" validate:"required"`
	BvnBootstrapPeers    []p2p.Multiaddr `json:"bvnBootstrapPeers,omitempty" form:"bvnBootstrapPeers" query:"bvnBootstrapPeers" validate:"required"`
	EnableHealing        *bool           `json:"enableHealing,omitempty" form:"enableHealing" query:"enableHealing"`
	EnableDirectDispatch *bool           `json:"enableDirectDispatch,omitempty" form:"enableDirectDispatch" query:"enableDirectDispatch"`
	MaxEnvelopesPerBlock *uint64         `json:"maxEnvelopesPerBlock,omitempty" form:"maxEnvelopesPerBlock" query:"maxEnvelopesPerBlock"`
	StorageType          *StorageType    `json:"storageType,omitempty" form:"storageType" query:"storageType"`
}

func (*CoreValidatorConfiguration) Copy

func (*CoreValidatorConfiguration) CopyAsInterface

func (v *CoreValidatorConfiguration) CopyAsInterface() interface{}

func (*CoreValidatorConfiguration) Equal

func (*CoreValidatorConfiguration) MarshalJSON

func (v *CoreValidatorConfiguration) MarshalJSON() ([]byte, error)

func (*CoreValidatorConfiguration) Type

func (*CoreValidatorConfiguration) UnmarshalJSON

func (v *CoreValidatorConfiguration) UnmarshalJSON(data []byte) error

type DevnetConfiguration

type DevnetConfiguration struct {
	Listen     p2p.Multiaddr         `json:"listen,omitempty" form:"listen" query:"listen" validate:"required"`
	Bvns       uint64                `json:"bvns,omitempty" form:"bvns" query:"bvns" validate:"required"`
	Validators uint64                `json:"validators,omitempty" form:"validators" query:"validators" validate:"required"`
	Followers  uint64                `json:"followers,omitempty" form:"followers" query:"followers"`
	Globals    *network.GlobalValues `json:"globals,omitempty" form:"globals" query:"globals" validate:"required"`
}

func (*DevnetConfiguration) Copy

func (*DevnetConfiguration) CopyAsInterface

func (v *DevnetConfiguration) CopyAsInterface() interface{}

func (*DevnetConfiguration) Equal

func (*DevnetConfiguration) MarshalJSON

func (v *DevnetConfiguration) MarshalJSON() ([]byte, error)

func (*DevnetConfiguration) Type

func (*DevnetConfiguration) UnmarshalJSON

func (v *DevnetConfiguration) UnmarshalJSON(data []byte) error

type DhtMode

type DhtMode dht.ModeOpt

func (DhtMode) MarshalJSON

func (d DhtMode) MarshalJSON() ([]byte, error)

func (DhtMode) String

func (d DhtMode) String() string

func (*DhtMode) UnmarshalJSON

func (d *DhtMode) UnmarshalJSON(b []byte) error

type EventsService

type EventsService struct {
	Partition string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
}

func (*EventsService) Copy

func (v *EventsService) Copy() *EventsService

func (*EventsService) CopyAsInterface

func (v *EventsService) CopyAsInterface() interface{}

func (*EventsService) Equal

func (v *EventsService) Equal(u *EventsService) bool

func (*EventsService) MarshalJSON

func (v *EventsService) MarshalJSON() ([]byte, error)

func (*EventsService) Provides

func (e *EventsService) Provides() []ioc.Provided

func (*EventsService) Requires

func (e *EventsService) Requires() []ioc.Requirement

func (*EventsService) Type

func (*EventsService) Type() ServiceType

func (*EventsService) UnmarshalJSON

func (v *EventsService) UnmarshalJSON(data []byte) error

type FaucetService

type FaucetService struct {
	Account    *url.URL                      `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	SigningKey PrivateKey                    `json:"signingKey,omitempty" form:"signingKey" query:"signingKey" validate:"required"`
	Router     *ServiceOrRef[*RouterService] `json:"router,omitempty" form:"router" query:"router" validate:"required"`
}

func (*FaucetService) Copy

func (v *FaucetService) Copy() *FaucetService

func (*FaucetService) CopyAsInterface

func (v *FaucetService) CopyAsInterface() interface{}

func (*FaucetService) Equal

func (v *FaucetService) Equal(u *FaucetService) bool

func (*FaucetService) MarshalJSON

func (v *FaucetService) MarshalJSON() ([]byte, error)

func (*FaucetService) Provides

func (f *FaucetService) Provides() []ioc.Provided

func (*FaucetService) Requires

func (f *FaucetService) Requires() []ioc.Requirement

func (*FaucetService) Type

func (*FaucetService) Type() ServiceType

func (*FaucetService) UnmarshalJSON

func (v *FaucetService) UnmarshalJSON(data []byte) error

type GatewayConfiguration

type GatewayConfiguration struct {
	Listen p2p.Multiaddr `json:"listen,omitempty" form:"listen" query:"listen" validate:"required"`
}

func (*GatewayConfiguration) Copy

func (*GatewayConfiguration) CopyAsInterface

func (v *GatewayConfiguration) CopyAsInterface() interface{}

func (*GatewayConfiguration) Equal

func (*GatewayConfiguration) MarshalJSON

func (v *GatewayConfiguration) MarshalJSON() ([]byte, error)

func (*GatewayConfiguration) Type

func (*GatewayConfiguration) UnmarshalJSON

func (v *GatewayConfiguration) UnmarshalJSON(data []byte) error

type HttpListener

type HttpListener struct {

	// Listen are the addresses and schemes to listen on.
	Listen []p2p.Multiaddr `json:"listen,omitempty" form:"listen" query:"listen" validate:"required"`
	// ConnectionLimit limits the number of concurrent connections.
	ConnectionLimit *int64 `json:"connectionLimit,omitempty" form:"connectionLimit" query:"connectionLimit"`
	// ReadHeaderTimeout protects against slow-loris attacks.
	ReadHeaderTimeout *time.Duration `json:"readHeaderTimeout,omitempty" form:"readHeaderTimeout" query:"readHeaderTimeout"`
	// TlsCertPath is the path of the TLS certificate.
	TlsCertPath string `json:"tlsCertPath,omitempty" form:"tlsCertPath" query:"tlsCertPath"`
	// TlsKeyPath is the path of the TLS key.
	TlsKeyPath string `json:"tlsKeyPath,omitempty" form:"tlsKeyPath" query:"tlsKeyPath"`
}

func (*HttpListener) Copy

func (v *HttpListener) Copy() *HttpListener

func (*HttpListener) CopyAsInterface

func (v *HttpListener) CopyAsInterface() interface{}

func (*HttpListener) Equal

func (v *HttpListener) Equal(u *HttpListener) bool

func (*HttpListener) MarshalJSON

func (v *HttpListener) MarshalJSON() ([]byte, error)

func (*HttpListener) UnmarshalJSON

func (v *HttpListener) UnmarshalJSON(data []byte) error

type HttpPeerMapEntry

type HttpPeerMapEntry struct {
	ID         p2p.PeerID      `json:"id,omitempty" form:"id" query:"id" validate:"required"`
	Partitions []string        `json:"partitions,omitempty" form:"partitions" query:"partitions" validate:"required"`
	Addresses  []p2p.Multiaddr `json:"addresses,omitempty" form:"addresses" query:"addresses" validate:"required"`
	// contains filtered or unexported fields
}

func (*HttpPeerMapEntry) Copy

func (*HttpPeerMapEntry) CopyAsInterface

func (v *HttpPeerMapEntry) CopyAsInterface() interface{}

func (*HttpPeerMapEntry) Equal

func (v *HttpPeerMapEntry) Equal(u *HttpPeerMapEntry) bool

func (*HttpPeerMapEntry) IsValid

func (v *HttpPeerMapEntry) IsValid() error

func (*HttpPeerMapEntry) MarshalBinary

func (v *HttpPeerMapEntry) MarshalBinary() ([]byte, error)

func (*HttpPeerMapEntry) MarshalJSON

func (v *HttpPeerMapEntry) MarshalJSON() ([]byte, error)

func (*HttpPeerMapEntry) UnmarshalBinary

func (v *HttpPeerMapEntry) UnmarshalBinary(data []byte) error

func (*HttpPeerMapEntry) UnmarshalBinaryFrom

func (v *HttpPeerMapEntry) UnmarshalBinaryFrom(rd io.Reader) error

func (*HttpPeerMapEntry) UnmarshalJSON

func (v *HttpPeerMapEntry) UnmarshalJSON(data []byte) error

type HttpService

type HttpService struct {
	HttpListener
	// CorsOrigins is a list of allowed CORS origins.
	CorsOrigins []string `json:"corsOrigins,omitempty" form:"corsOrigins" query:"corsOrigins"`
	// LetsEncrypt automatically retrieves a certificate from Let's Encrypt for the specified domains.
	LetsEncrypt  []string                      `json:"letsEncrypt,omitempty" form:"letsEncrypt" query:"letsEncrypt"`
	DebugJsonRpc *bool                         `json:"debugJsonRpc,omitempty" form:"debugJsonRpc" query:"debugJsonRpc"`
	Router       *ServiceOrRef[*RouterService] `json:"router,omitempty" form:"router" query:"router" validate:"required"`
	// PeerMap hard-codes the peer map.
	PeerMap []*HttpPeerMapEntry `json:"peerMap,omitempty" form:"peerMap" query:"peerMap" validate:"required"`
}

func (*HttpService) Copy

func (v *HttpService) Copy() *HttpService

func (*HttpService) CopyAsInterface

func (v *HttpService) CopyAsInterface() interface{}

func (*HttpService) Equal

func (v *HttpService) Equal(u *HttpService) bool

func (*HttpService) MarshalJSON

func (v *HttpService) MarshalJSON() ([]byte, error)

func (*HttpService) Provides

func (h *HttpService) Provides() []ioc.Provided

func (*HttpService) Requires

func (h *HttpService) Requires() []ioc.Requirement

func (*HttpService) Type

func (*HttpService) Type() ServiceType

func (*HttpService) UnmarshalJSON

func (v *HttpService) UnmarshalJSON(data []byte) error

type Instance

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

func New

func New(ctx context.Context, cfg *Config) (*Instance, error)

func Start

func Start(ctx context.Context, cfg *Config) (*Instance, error)

func (*Instance) Reset

func (inst *Instance) Reset() error

func (*Instance) Start

func (inst *Instance) Start() error

func (*Instance) StartFiltered

func (inst *Instance) StartFiltered(predicate func(Service) bool) (err error)

func (*Instance) Stop

func (i *Instance) Stop()

type Instrumentation

type Instrumentation struct {
	HttpListener
}

func (*Instrumentation) Copy

func (v *Instrumentation) Copy() *Instrumentation

func (*Instrumentation) CopyAsInterface

func (v *Instrumentation) CopyAsInterface() interface{}

func (*Instrumentation) Equal

func (v *Instrumentation) Equal(u *Instrumentation) bool

func (*Instrumentation) MarshalJSON

func (v *Instrumentation) MarshalJSON() ([]byte, error)

func (*Instrumentation) UnmarshalJSON

func (v *Instrumentation) UnmarshalJSON(data []byte) error

type Logging

type Logging struct {
	Format string         `json:"format,omitempty" form:"format" query:"format" validate:"required"`
	Color  *bool          `json:"color,omitempty" form:"color" query:"color" validate:"required"`
	Rules  []*LoggingRule `json:"rules,omitempty" form:"rules" query:"rules" validate:"required"`
}

func (*Logging) Copy

func (v *Logging) Copy() *Logging

func (*Logging) CopyAsInterface

func (v *Logging) CopyAsInterface() interface{}

func (*Logging) Equal

func (v *Logging) Equal(u *Logging) bool

func (*Logging) MarshalJSON

func (v *Logging) MarshalJSON() ([]byte, error)

func (*Logging) UnmarshalJSON

func (v *Logging) UnmarshalJSON(data []byte) error

type LoggingRule

type LoggingRule struct {
	Level   slog.Level `json:"level" form:"level" query:"level" validate:"required"`
	Modules []string   `json:"modules,omitempty" form:"modules" query:"modules" validate:"required"`
}

func (*LoggingRule) Copy

func (v *LoggingRule) Copy() *LoggingRule

func (*LoggingRule) CopyAsInterface

func (v *LoggingRule) CopyAsInterface() interface{}

func (*LoggingRule) Equal

func (v *LoggingRule) Equal(u *LoggingRule) bool

func (*LoggingRule) MarshalJSON

func (v *LoggingRule) MarshalJSON() ([]byte, error)

func (*LoggingRule) UnmarshalJSON

func (v *LoggingRule) UnmarshalJSON(data []byte) error

type MemoryStorage

type MemoryStorage struct {
}

func (*MemoryStorage) Copy

func (v *MemoryStorage) Copy() *MemoryStorage

func (*MemoryStorage) CopyAsInterface

func (v *MemoryStorage) CopyAsInterface() interface{}

func (*MemoryStorage) Equal

func (v *MemoryStorage) Equal(u *MemoryStorage) bool

func (*MemoryStorage) MarshalJSON

func (v *MemoryStorage) MarshalJSON() ([]byte, error)

func (*MemoryStorage) Type

func (*MemoryStorage) Type() StorageType

func (*MemoryStorage) UnmarshalJSON

func (v *MemoryStorage) UnmarshalJSON(data []byte) error

type MetricsService

type MetricsService struct {
	Partition string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
}

func (*MetricsService) Copy

func (v *MetricsService) Copy() *MetricsService

func (*MetricsService) CopyAsInterface

func (v *MetricsService) CopyAsInterface() interface{}

func (*MetricsService) Equal

func (v *MetricsService) Equal(u *MetricsService) bool

func (*MetricsService) MarshalJSON

func (v *MetricsService) MarshalJSON() ([]byte, error)

func (*MetricsService) Provides

func (m *MetricsService) Provides() []ioc.Provided

func (*MetricsService) Requires

func (m *MetricsService) Requires() []ioc.Requirement

func (*MetricsService) Type

func (*MetricsService) Type() ServiceType

func (*MetricsService) UnmarshalJSON

func (v *MetricsService) UnmarshalJSON(data []byte) error

type NetworkService

type NetworkService struct {
	Partition string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
}

func (*NetworkService) Copy

func (v *NetworkService) Copy() *NetworkService

func (*NetworkService) CopyAsInterface

func (v *NetworkService) CopyAsInterface() interface{}

func (*NetworkService) Equal

func (v *NetworkService) Equal(u *NetworkService) bool

func (*NetworkService) MarshalJSON

func (v *NetworkService) MarshalJSON() ([]byte, error)

func (*NetworkService) Provides

func (n *NetworkService) Provides() []ioc.Provided

func (*NetworkService) Requires

func (n *NetworkService) Requires() []ioc.Requirement

func (*NetworkService) Type

func (*NetworkService) Type() ServiceType

func (*NetworkService) UnmarshalJSON

func (v *NetworkService) UnmarshalJSON(data []byte) error

type P2P

type P2P struct {
	Listen             []p2p.Multiaddr `json:"listen,omitempty" form:"listen" query:"listen" validate:"required"`
	BootstrapPeers     []p2p.Multiaddr `json:"bootstrapPeers,omitempty" form:"bootstrapPeers" query:"bootstrapPeers" validate:"required"`
	Key                PrivateKey      `json:"key,omitempty" form:"key" query:"key" validate:"required"`
	PeerDB             *string         `json:"peerDB,omitempty" form:"peerDB" query:"peerDB" validate:"required"`
	EnablePeerTracking bool            `json:"enablePeerTracking,omitempty" form:"enablePeerTracking" query:"enablePeerTracking" validate:"required"`
	DiscoveryMode      *DhtMode        `json:"discoveryMode,omitempty" form:"discoveryMode" query:"discoveryMode" validate:"required"`
	External           p2p.Multiaddr   `json:"external,omitempty" form:"external" query:"external" validate:"required"`
}

func (*P2P) Copy

func (v *P2P) Copy() *P2P

func (*P2P) CopyAsInterface

func (v *P2P) CopyAsInterface() interface{}

func (*P2P) Equal

func (v *P2P) Equal(u *P2P) bool

func (*P2P) MarshalJSON

func (v *P2P) MarshalJSON() ([]byte, error)

func (*P2P) UnmarshalJSON

func (v *P2P) UnmarshalJSON(data []byte) error

type PrivateKey

type PrivateKey interface {
	Type() PrivateKeyType
	CopyAsInterface() any
	// contains filtered or unexported methods
}

func CopyPrivateKey

func CopyPrivateKey(v PrivateKey) PrivateKey

CopyPrivateKey copies a PrivateKey.

func NewPrivateKey

func NewPrivateKey(typ PrivateKeyType) (PrivateKey, error)

NewPrivateKey creates a new PrivateKey for the specified PrivateKeyType.

func UnmarshalPrivateKeyJSON

func UnmarshalPrivateKeyJSON(data []byte) (PrivateKey, error)

UnmarshalPrivateKeyJson unmarshals a PrivateKey.

type PrivateKeySeed

type PrivateKeySeed struct {
	Seed *record.Key `json:"seed,omitempty" form:"seed" query:"seed" validate:"required"`
	// contains filtered or unexported fields
}

func (*PrivateKeySeed) Copy

func (v *PrivateKeySeed) Copy() *PrivateKeySeed

func (*PrivateKeySeed) CopyAsInterface

func (v *PrivateKeySeed) CopyAsInterface() interface{}

func (*PrivateKeySeed) Equal

func (v *PrivateKeySeed) Equal(u *PrivateKeySeed) bool

func (*PrivateKeySeed) MarshalJSON

func (v *PrivateKeySeed) MarshalJSON() ([]byte, error)

func (*PrivateKeySeed) Type

func (*PrivateKeySeed) UnmarshalJSON

func (v *PrivateKeySeed) UnmarshalJSON(data []byte) error

type PrivateKeyType

type PrivateKeyType int
const PrivateKeyTypeCometNodeKeyFile PrivateKeyType = 5

PrivateKeyTypeCometNodeKeyFile .

const PrivateKeyTypeCometPrivValFile PrivateKeyType = 4

PrivateKeyTypeCometPrivValFile .

const PrivateKeyTypeRaw PrivateKeyType = 1

PrivateKeyTypeRaw .

const PrivateKeyTypeSeed PrivateKeyType = 3

PrivateKeyTypeSeed .

const PrivateKeyTypeTransient PrivateKeyType = 2

PrivateKeyTypeTransient .

func PrivateKeyTypeByName

func PrivateKeyTypeByName(name string) (PrivateKeyType, bool)

PrivateKeyTypeByName returns the named Private Key Type.

func (PrivateKeyType) GetEnumValue

func (v PrivateKeyType) GetEnumValue() uint64

GetEnumValue returns the value of the Private Key Type

func (PrivateKeyType) MarshalJSON

func (v PrivateKeyType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Private Key Type to JSON as a string.

func (*PrivateKeyType) SetEnumValue

func (v *PrivateKeyType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (PrivateKeyType) String

func (v PrivateKeyType) String() string

String returns the name of the Private Key Type.

func (*PrivateKeyType) UnmarshalJSON

func (v *PrivateKeyType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Private Key Type from JSON as a string.

type Querier

type Querier struct {
	Partition string        `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	Storage   *StorageOrRef `json:"storage,omitempty" form:"storage" query:"storage"`
}

func (*Querier) Copy

func (v *Querier) Copy() *Querier

func (*Querier) CopyAsInterface

func (v *Querier) CopyAsInterface() interface{}

func (*Querier) Equal

func (v *Querier) Equal(u *Querier) bool

func (*Querier) MarshalJSON

func (v *Querier) MarshalJSON() ([]byte, error)

func (*Querier) Provides

func (q *Querier) Provides() []ioc.Provided

func (*Querier) Requires

func (q *Querier) Requires() []ioc.Requirement

func (*Querier) Type

func (*Querier) Type() ServiceType

func (*Querier) UnmarshalJSON

func (v *Querier) UnmarshalJSON(data []byte) error

type RawPrivateKey

type RawPrivateKey struct {
	Address string `json:"address,omitempty" form:"address" query:"address" validate:"required"`
}

func (*RawPrivateKey) Copy

func (v *RawPrivateKey) Copy() *RawPrivateKey

func (*RawPrivateKey) CopyAsInterface

func (v *RawPrivateKey) CopyAsInterface() interface{}

func (*RawPrivateKey) Equal

func (v *RawPrivateKey) Equal(u *RawPrivateKey) bool

func (*RawPrivateKey) MarshalJSON

func (v *RawPrivateKey) MarshalJSON() ([]byte, error)

func (*RawPrivateKey) Type

func (*RawPrivateKey) Type() PrivateKeyType

func (*RawPrivateKey) UnmarshalJSON

func (v *RawPrivateKey) UnmarshalJSON(data []byte) error

type RouterService

type RouterService struct {
	Name string `json:"name,omitempty" form:"name" query:"name"`
	// Events may specify an event bus to use for routing table updates.
	Events string `json:"events,omitempty" form:"events" query:"events"`
	// contains filtered or unexported fields
}

func (*RouterService) Copy

func (v *RouterService) Copy() *RouterService

func (*RouterService) CopyAsInterface

func (v *RouterService) CopyAsInterface() interface{}

func (*RouterService) Equal

func (v *RouterService) Equal(u *RouterService) bool

func (*RouterService) IsValid

func (v *RouterService) IsValid() error

func (*RouterService) MarshalBinary

func (v *RouterService) MarshalBinary() ([]byte, error)

func (*RouterService) MarshalJSON

func (v *RouterService) MarshalJSON() ([]byte, error)

func (*RouterService) Provides

func (r *RouterService) Provides() []ioc.Provided

func (*RouterService) Requires

func (r *RouterService) Requires() []ioc.Requirement

func (*RouterService) Type

func (*RouterService) Type() ServiceType

func (*RouterService) UnmarshalBinary

func (v *RouterService) UnmarshalBinary(data []byte) error

func (*RouterService) UnmarshalBinaryFrom

func (v *RouterService) UnmarshalBinaryFrom(rd io.Reader) error

func (*RouterService) UnmarshalFieldsFrom

func (v *RouterService) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*RouterService) UnmarshalJSON

func (v *RouterService) UnmarshalJSON(data []byte) error

type Service

type Service interface {
	ioc.Factory

	Type() ServiceType
	CopyAsInterface() any
	// contains filtered or unexported methods
}

func CopyService

func CopyService(v Service) Service

CopyService copies a Service.

func NewService

func NewService(typ ServiceType) (Service, error)

NewService creates a new Service for the specified ServiceType.

func UnmarshalServiceJSON

func UnmarshalServiceJSON(data []byte) (Service, error)

UnmarshalServiceJson unmarshals a Service.

type ServiceOrRef

type ServiceOrRef[T serviceType[T]] baseRef[T]

func ServiceReference

func ServiceReference[T serviceType[T]](ref string) *ServiceOrRef[T]

func ServiceValue

func ServiceValue[T serviceType[T]](service T) *ServiceOrRef[T]

func (*ServiceOrRef[T]) Copy

func (s *ServiceOrRef[T]) Copy() *ServiceOrRef[T]

func (*ServiceOrRef[T]) Equal

func (s *ServiceOrRef[T]) Equal(t *ServiceOrRef[T]) bool

func (*ServiceOrRef[T]) MarshalJSON

func (s *ServiceOrRef[T]) MarshalJSON() ([]byte, error)

func (*ServiceOrRef[T]) RequiresOr

func (s *ServiceOrRef[T]) RequiresOr(def ...ioc.Requirement) []ioc.Requirement

func (*ServiceOrRef[T]) UnmarshalJSON

func (s *ServiceOrRef[T]) UnmarshalJSON(b []byte) error

type ServiceType

type ServiceType int
const ServiceTypeConsensus ServiceType = 2

ServiceTypeConsensus .

const ServiceTypeEvents ServiceType = 6

ServiceTypeEvents .

const ServiceTypeFaucet ServiceType = 10

ServiceTypeFaucet .

const ServiceTypeHttp ServiceType = 7

ServiceTypeHttp .

const ServiceTypeMetrics ServiceType = 5

ServiceTypeMetrics .

const ServiceTypeNetwork ServiceType = 4

ServiceTypeNetwork .

const ServiceTypeQuerier ServiceType = 3

ServiceTypeQuerier .

const ServiceTypeRouter ServiceType = 8

ServiceTypeRouter .

const ServiceTypeSnapshot ServiceType = 9

ServiceTypeSnapshot .

const ServiceTypeStorage ServiceType = 1

ServiceTypeStorage .

const ServiceTypeSubnode ServiceType = 11

ServiceTypeSubnode .

func ServiceTypeByName

func ServiceTypeByName(name string) (ServiceType, bool)

ServiceTypeByName returns the named Service Type.

func (ServiceType) GetEnumValue

func (v ServiceType) GetEnumValue() uint64

GetEnumValue returns the value of the Service Type

func (ServiceType) MarshalJSON

func (v ServiceType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Service Type to JSON as a string.

func (*ServiceType) SetEnumValue

func (v *ServiceType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (ServiceType) String

func (v ServiceType) String() string

String returns the name of the Service Type.

func (*ServiceType) UnmarshalJSON

func (v *ServiceType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Service Type from JSON as a string.

type SnapshotService

type SnapshotService struct {
	Partition string        `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	Storage   *StorageOrRef `json:"storage,omitempty" form:"storage" query:"storage"`
	// Directory is the directory to store snapshots in.
	Directory string `json:"directory,omitempty" form:"directory" query:"directory" validate:"required"`
	// Schedule is the schedule for capturing snapshots.
	Schedule *network.CronSchedule `json:"schedule,omitempty" form:"schedule" query:"schedule"`
	// RetainCount is the number of snapshots to retain.
	RetainCount *uint64 `json:"retainCount,omitempty" form:"retainCount" query:"retainCount"`
	// EnableIndexing enables indexing of snapshots.
	EnableIndexing *bool `json:"enableIndexing,omitempty" form:"enableIndexing" query:"enableIndexing"`
}

func (*SnapshotService) Copy

func (v *SnapshotService) Copy() *SnapshotService

func (*SnapshotService) CopyAsInterface

func (v *SnapshotService) CopyAsInterface() interface{}

func (*SnapshotService) Equal

func (v *SnapshotService) Equal(u *SnapshotService) bool

func (*SnapshotService) MarshalJSON

func (v *SnapshotService) MarshalJSON() ([]byte, error)

func (*SnapshotService) Provides

func (s *SnapshotService) Provides() []ioc.Provided

func (*SnapshotService) Requires

func (s *SnapshotService) Requires() []ioc.Requirement

func (*SnapshotService) Type

func (*SnapshotService) Type() ServiceType

func (*SnapshotService) UnmarshalJSON

func (v *SnapshotService) UnmarshalJSON(data []byte) error

type Storage

type Storage interface {
	Type() StorageType
	CopyAsInterface() any
	// contains filtered or unexported methods
}

func CopyStorage

func CopyStorage(v Storage) Storage

CopyStorage copies a Storage.

func NewStorage

func NewStorage(typ StorageType) (Storage, error)

NewStorage creates a new Storage for the specified StorageType.

func UnmarshalStorageJSON

func UnmarshalStorageJSON(data []byte) (Storage, error)

UnmarshalStorageJson unmarshals a Storage.

type StorageOrRef

type StorageOrRef baseRef[Storage]

func (*StorageOrRef) Copy

func (s *StorageOrRef) Copy() *StorageOrRef

func (*StorageOrRef) Equal

func (s *StorageOrRef) Equal(t *StorageOrRef) bool

func (*StorageOrRef) MarshalJSON

func (s *StorageOrRef) MarshalJSON() ([]byte, error)

func (*StorageOrRef) Required

func (s *StorageOrRef) Required(def string) []ioc.Requirement

func (*StorageOrRef) UnmarshalJSON

func (s *StorageOrRef) UnmarshalJSON(b []byte) error

type StorageService

type StorageService struct {
	Name    string  `json:"name,omitempty" form:"name" query:"name"`
	Storage Storage `json:"storage,omitempty" form:"storage" query:"storage" validate:"required"`
}

func (*StorageService) Copy

func (v *StorageService) Copy() *StorageService

func (*StorageService) CopyAsInterface

func (v *StorageService) CopyAsInterface() interface{}

func (*StorageService) Equal

func (v *StorageService) Equal(u *StorageService) bool

func (*StorageService) MarshalJSON

func (v *StorageService) MarshalJSON() ([]byte, error)

func (*StorageService) Provides

func (c *StorageService) Provides() []ioc.Provided

func (*StorageService) Requires

func (c *StorageService) Requires() []ioc.Requirement

func (*StorageService) Type

func (*StorageService) Type() ServiceType

func (*StorageService) UnmarshalJSON

func (v *StorageService) UnmarshalJSON(data []byte) error

type StorageType

type StorageType int
const StorageTypeBadger StorageType = 2

StorageTypeBadger .

const StorageTypeMemory StorageType = 1

StorageTypeMemory .

func StorageTypeByName

func StorageTypeByName(name string) (StorageType, bool)

StorageTypeByName returns the named Storage Type.

func (StorageType) GetEnumValue

func (v StorageType) GetEnumValue() uint64

GetEnumValue returns the value of the Storage Type

func (StorageType) MarshalJSON

func (v StorageType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Storage Type to JSON as a string.

func (*StorageType) SetEnumValue

func (v *StorageType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (StorageType) String

func (v StorageType) String() string

String returns the name of the Storage Type.

func (*StorageType) UnmarshalJSON

func (v *StorageType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Storage Type from JSON as a string.

type SubnodeService

type SubnodeService struct {
	Name     string     `json:"name,omitempty" form:"name" query:"name" validate:"required"`
	NodeKey  PrivateKey `json:"nodeKey,omitempty" form:"nodeKey" query:"nodeKey" validate:"required"`
	Services []Service  `json:"services,omitempty" form:"services" query:"services" validate:"required"`
}

func (*SubnodeService) Copy

func (v *SubnodeService) Copy() *SubnodeService

func (*SubnodeService) CopyAsInterface

func (v *SubnodeService) CopyAsInterface() interface{}

func (*SubnodeService) Equal

func (v *SubnodeService) Equal(u *SubnodeService) bool

func (*SubnodeService) MarshalJSON

func (v *SubnodeService) MarshalJSON() ([]byte, error)

func (*SubnodeService) Provides

func (s *SubnodeService) Provides() []ioc.Provided

func (*SubnodeService) Requires

func (s *SubnodeService) Requires() []ioc.Requirement

func (*SubnodeService) Type

func (*SubnodeService) Type() ServiceType

func (*SubnodeService) UnmarshalJSON

func (v *SubnodeService) UnmarshalJSON(data []byte) error

type TransientPrivateKey

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

func (*TransientPrivateKey) Copy

func (*TransientPrivateKey) CopyAsInterface

func (v *TransientPrivateKey) CopyAsInterface() interface{}

func (*TransientPrivateKey) Equal

func (*TransientPrivateKey) MarshalJSON

func (v *TransientPrivateKey) MarshalJSON() ([]byte, error)

func (*TransientPrivateKey) Type

func (*TransientPrivateKey) UnmarshalJSON

func (v *TransientPrivateKey) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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