common

package
v0.6.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthInfo        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowInfo          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupInfo = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrIPFSNotInitialized = errors.New("IPFS not initialized")
)

Functions

This section is empty.

Types

type DIDConfig added in v0.4.4

type DIDConfig struct {
	// Method is the DID method name
	Method string `json:"method"`

	// Network is the DID network name
	Network string `json:"network"`

	// Identifier is the DID identifier
	Identifier string `json:"identifier"`

	// Path is the DID path
	Path string `json:"path"`

	// Fragment is the DID fragment
	Fragment string `json:"fragment"`
}

DIDConfig is a DID URI config

func DefaultDidUriConfig added in v0.4.4

func DefaultDidUriConfig() *DIDConfig

DefaultDidUriConfig returns a new DID URI config with default values

func (*DIDConfig) Apply added in v0.4.4

func (c *DIDConfig) Apply(opts ...DIDOption) string

Apply applies the options and returns a constructed valid DID URI

type DIDOption added in v0.4.4

type DIDOption func(*DIDConfig)

DIDOption is a function that configures a DID URI config

func WithFragment added in v0.4.4

func WithFragment(fragment string) DIDOption

WithFragment sets the DID fragment

func WithIdentifier added in v0.4.4

func WithIdentifier(identifier string) DIDOption

WithIdentifier sets the DID identifier

func WithMethod added in v0.4.4

func WithMethod(method string) DIDOption

WithMethod sets the DID method name

func WithNetwork added in v0.4.4

func WithNetwork(network string) DIDOption

WithNetwork sets the DID network name

func WithPath added in v0.4.4

func WithPath(path string) DIDOption

WithPath sets the DID path

type PeerInfo

type PeerInfo struct {
	Id        string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name      string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	PeerId    string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	Multiaddr string `protobuf:"bytes,4,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"`
}

Basic Info Sent to Peers to Establish Connections

func (*PeerInfo) Descriptor

func (*PeerInfo) Descriptor() ([]byte, []int)

func (*PeerInfo) GetId

func (m *PeerInfo) GetId() string

func (*PeerInfo) GetMultiaddr

func (m *PeerInfo) GetMultiaddr() string

func (*PeerInfo) GetName

func (m *PeerInfo) GetName() string

func (*PeerInfo) GetPeerId

func (m *PeerInfo) GetPeerId() string

func (*PeerInfo) Marshal

func (m *PeerInfo) Marshal() (dAtA []byte, err error)

func (*PeerInfo) MarshalTo

func (m *PeerInfo) MarshalTo(dAtA []byte) (int, error)

func (*PeerInfo) MarshalToSizedBuffer

func (m *PeerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) Reset

func (m *PeerInfo) Reset()

func (*PeerInfo) Size

func (m *PeerInfo) Size() (n int)

func (*PeerInfo) String

func (m *PeerInfo) String() string

func (*PeerInfo) Unmarshal

func (m *PeerInfo) Unmarshal(dAtA []byte) error

func (*PeerInfo) XXX_DiscardUnknown

func (m *PeerInfo) XXX_DiscardUnknown()

func (*PeerInfo) XXX_Marshal

func (m *PeerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerInfo) XXX_Merge

func (m *PeerInfo) XXX_Merge(src proto.Message)

func (*PeerInfo) XXX_Size

func (m *PeerInfo) XXX_Size() int

func (*PeerInfo) XXX_Unmarshal

func (m *PeerInfo) XXX_Unmarshal(b []byte) error

type SNRPubKey added in v0.4.4

type SNRPubKey interface {
	cryptotypes.PubKey

	Bech32(pfix string) (string, error)
	Multibase() string
	Raw() []byte
}

`SNRPubKey` is a `PubKey` that has a `DID` and a `Multibase` @property {string} DID - The DID of the SNR @property {string} Multibase - The multibase encoding of the DID.

type WalletInfo

type WalletInfo struct {
	// Controller is the associated Sonr address.
	Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"`
	// DiscoverPaths is a list of all known hardened coin type paths.
	DiscoveredPaths []int32 `protobuf:"varint,2,rep,packed,name=discovered_paths,json=discoveredPaths,proto3" json:"discovered_paths,omitempty"`
	// Algorithm is the algorithm of the wallet. CMP is the default.
	Algorithm string `protobuf:"bytes,3,opt,name=algorithm,proto3" json:"algorithm,omitempty"`
	// CreatedAt is the time the wallet was created.
	CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// LastUpdated is the last time the wallet was updated.
	LastUpdated int64 `protobuf:"varint,5,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
}

func (*WalletInfo) Descriptor

func (*WalletInfo) Descriptor() ([]byte, []int)

func (*WalletInfo) GetAlgorithm

func (m *WalletInfo) GetAlgorithm() string

func (*WalletInfo) GetController

func (m *WalletInfo) GetController() string

func (*WalletInfo) GetCreatedAt

func (m *WalletInfo) GetCreatedAt() int64

func (*WalletInfo) GetDiscoveredPaths

func (m *WalletInfo) GetDiscoveredPaths() []int32

func (*WalletInfo) GetLastUpdated

func (m *WalletInfo) GetLastUpdated() int64

func (*WalletInfo) Marshal

func (m *WalletInfo) Marshal() (dAtA []byte, err error)

func (*WalletInfo) MarshalTo

func (m *WalletInfo) MarshalTo(dAtA []byte) (int, error)

func (*WalletInfo) MarshalToSizedBuffer

func (m *WalletInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WalletInfo) ProtoMessage

func (*WalletInfo) ProtoMessage()

func (*WalletInfo) Reset

func (m *WalletInfo) Reset()

func (*WalletInfo) Size

func (m *WalletInfo) Size() (n int)

func (*WalletInfo) String

func (m *WalletInfo) String() string

func (*WalletInfo) Unmarshal

func (m *WalletInfo) Unmarshal(dAtA []byte) error

func (*WalletInfo) XXX_DiscardUnknown

func (m *WalletInfo) XXX_DiscardUnknown()

func (*WalletInfo) XXX_Marshal

func (m *WalletInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WalletInfo) XXX_Merge

func (m *WalletInfo) XXX_Merge(src proto.Message)

func (*WalletInfo) XXX_Size

func (m *WalletInfo) XXX_Size() int

func (*WalletInfo) XXX_Unmarshal

func (m *WalletInfo) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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