config

package
v0.0.0-...-a192842 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	AppName    string `json:"appName"`
	AppVersion string `json:"appVersion"`
	ProtocolID string `json:"protocolID"`
}

func (*AppConfig) Protocol

func (a *AppConfig) Protocol() protocol.ID

type Config

type Config struct {
	*PrivateKey  `json:"privateKey"`
	*AppConfig   `json:"appConfig"`
	*RemotePeers `json:"remotePeers"`
	ListenAddrs  []string `json:"listenAddrs"`
	Username     string   `json:"name"`
}

func (*Config) ReadConfig

func (c *Config) ReadConfig() (*Config, error)

type PrivateKey

type PrivateKey struct {
	Dir      string `json:"dir"`
	FileName string `json:"fileName"`
}

func (*PrivateKey) GenerateSecp256k1KeyPair

func (p *PrivateKey) GenerateSecp256k1KeyPair() (crypto.PrivKey, crypto.PubKey)

func (*PrivateKey) IsPresent

func (p *PrivateKey) IsPresent() bool

func (*PrivateKey) Read

func (p *PrivateKey) Read() (crypto.PrivKey, error)

func (*PrivateKey) Write

func (p *PrivateKey) Write(privKey *[]byte) error

type RemotePeer

type RemotePeer struct {
	DialAddrs []string `json:"dialAddrs"`
	UserName  string   `json:"name"`
}

func (*RemotePeer) Addresses

func (rp *RemotePeer) Addresses() []peer.AddrInfo

func (*RemotePeer) PeerId

func (rp *RemotePeer) PeerId() *peer.ID

type RemotePeers

type RemotePeers []*RemotePeer

Jump to

Keyboard shortcuts

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