common

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ON_REFRESH is an event type for when the LobbyProtocol is refreshed
	ON_REFRESH = events.EventName("on_refresh")

	// ON_MAILBOX is an event type for when the MailboxProtocol receives a MailboxEvent
	ON_MAILBOX = events.EventName("on_mailbox")

	// ON_INVITE is an event type for when the TransferProtocol receives InviteEvent
	ON_INVITE = events.EventName("on_invite")

	// ON_DECISION is an event type for when the TransferProtocol receives a DecisionEvent
	ON_DECISION = events.EventName("on_decision")

	// ON_PROGRESS is an event type for when the TransferProtocol sends or receives a ProgressEvent
	ON_PROGRESS = events.EventName("on_progress")

	// ON_COMPLETE is an event type for when the TransferProtocol completes a transfer and pushes a CompleteEvent
	ON_COMPLETE = events.EventName("on_complete")
)

Variables

View Source
var (
	ErrRequestBody = errors.New("Provided HTTP request body is empty or invalid.")

	// Path Manipulation Errors
	ErrDuplicateFilePathOption    = errors.New("Duplicate file path option")
	ErrPrefixSuffixSetWithReplace = errors.New("Prefix or Suffix set with Replace.")
	ErrSeparatorLength            = errors.New("Separator length must be 1.")
	ErrNoFileNameSet              = errors.New("File name was not set by options.")

	// Device ID Errors
	ErrEmptyDeviceID = errors.New("Device ID cannot be empty")
	ErrMissingEnvVar = errors.New("Cannot set EnvVariable with empty value")

	// Directory errors
	ErrDirectoryInvalid = errors.New("Directory Type is invalid")
	ErrDirectoryUnset   = errors.New("Directory path has not been set")
	ErrDirectoryJoin    = errors.New("Failed to join directory path")

	// Node Errors
	ErrEmptyQueue       = errors.New("No items in Transfer Queue.")
	ErrInvalidQuery     = errors.New("No SName or PeerID provided.")
	ErrMissingParam     = errors.New("Paramater is missing.")
	ErrProtocolsNotSet  = errors.New("Node Protocol has not been initialized.")
	ErrRoutingNotSet    = errors.New("DHT and Host have not been set by Routing Function")
	ErrListenerRequired = errors.New("Listener was not Provided")
	ErrMDNSInvalidConn  = errors.New("Invalid Connection, cannot begin MDNS Service")
)
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 (
	ErrInvalidLengthIpns        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowIpns          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupIpns = fmt.Errorf("proto: unexpected end of group")
)
View Source
var BlockchainModule_name = map[int32]string{
	0: "REGISTRY",
	1: "SCHEMA",
	2: "BUCKET",
}
View Source
var BlockchainModule_value = map[string]int32{
	"REGISTRY": 0,
	"SCHEMA":   1,
	"BUCKET":   2,
}
View Source
var EntityKind_name = map[int32]string{
	0: "ADDRESS",
	1: "DID",
	2: "CID",
}
View Source
var EntityKind_value = map[string]int32{
	"ADDRESS": 0,
	"DID":     1,
	"CID":     2,
}
View Source
var IpnsEntry_ValidityType_name = map[int32]string{
	0: "EOL",
}
View Source
var IpnsEntry_ValidityType_value = map[string]int32{
	"EOL": 0,
}
View Source
var Peer_Status_name = map[int32]string{
	0: "STATUS_UNSPECIFIED",
	1: "STATUS_ONLINE",
	2: "STATUS_AWAY",
	3: "STATUS_BUSY",
}
View Source
var Peer_Status_value = map[string]int32{
	"STATUS_UNSPECIFIED": 0,
	"STATUS_ONLINE":      1,
	"STATUS_AWAY":        2,
	"STATUS_BUSY":        3,
}

Functions

This section is empty.

Types

type BlockchainModule

type BlockchainModule int32
const (
	// Query x/registry module
	BlockchainModule_REGISTRY BlockchainModule = 0
	// Query x/schema module
	BlockchainModule_SCHEMA BlockchainModule = 1
	// Query x/bucket module
	BlockchainModule_BUCKET BlockchainModule = 2
)

func (BlockchainModule) EnumDescriptor

func (BlockchainModule) EnumDescriptor() ([]byte, []int)

func (BlockchainModule) String

func (x BlockchainModule) String() string

type EntityKind

type EntityKind int32
const (
	EntityKind_ADDRESS EntityKind = 0
	EntityKind_DID     EntityKind = 1
	EntityKind_CID     EntityKind = 2
)

func (EntityKind) EnumDescriptor

func (EntityKind) EnumDescriptor() ([]byte, []int)

func (EntityKind) String

func (x EntityKind) String() string

type IpnsEntry

type IpnsEntry struct {
	Value        []byte                 `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	Signature    []byte                 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	ValidityType IpnsEntry_ValidityType `protobuf:"varint,3,opt,name=validityType,proto3,enum=sonrio.common.v1.IpnsEntry_ValidityType" json:"validityType,omitempty"`
	Validity     []byte                 `protobuf:"bytes,4,opt,name=validity,proto3" json:"validity,omitempty"`
	Sequence     uint64                 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"`
	Ttl          uint64                 `protobuf:"varint,6,opt,name=ttl,proto3" json:"ttl,omitempty"`
	PubKey       []byte                 `protobuf:"bytes,7,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
}

func (*IpnsEntry) Descriptor

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

func (*IpnsEntry) GetPubKey

func (m *IpnsEntry) GetPubKey() []byte

func (*IpnsEntry) GetSequence

func (m *IpnsEntry) GetSequence() uint64

func (*IpnsEntry) GetSignature

func (m *IpnsEntry) GetSignature() []byte

func (*IpnsEntry) GetTtl

func (m *IpnsEntry) GetTtl() uint64

func (*IpnsEntry) GetValidity

func (m *IpnsEntry) GetValidity() []byte

func (*IpnsEntry) GetValidityType

func (m *IpnsEntry) GetValidityType() IpnsEntry_ValidityType

func (*IpnsEntry) GetValue

func (m *IpnsEntry) GetValue() []byte

func (*IpnsEntry) Marshal

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

func (*IpnsEntry) MarshalTo

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

func (*IpnsEntry) MarshalToSizedBuffer

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

func (*IpnsEntry) ProtoMessage

func (*IpnsEntry) ProtoMessage()

func (*IpnsEntry) Reset

func (m *IpnsEntry) Reset()

func (*IpnsEntry) Size

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

func (*IpnsEntry) String

func (m *IpnsEntry) String() string

func (*IpnsEntry) Unmarshal

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

func (*IpnsEntry) XXX_DiscardUnknown

func (m *IpnsEntry) XXX_DiscardUnknown()

func (*IpnsEntry) XXX_Marshal

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

func (*IpnsEntry) XXX_Merge

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

func (*IpnsEntry) XXX_Size

func (m *IpnsEntry) XXX_Size() int

func (*IpnsEntry) XXX_Unmarshal

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

type IpnsEntry_ValidityType

type IpnsEntry_ValidityType int32
const (
	// setting an EOL says "this record is valid until..."
	IpnsEntry_EOL IpnsEntry_ValidityType = 0
)

func (IpnsEntry_ValidityType) EnumDescriptor

func (IpnsEntry_ValidityType) EnumDescriptor() ([]byte, []int)

func (IpnsEntry_ValidityType) String

func (x IpnsEntry_ValidityType) String() string

type MotorCallback

type MotorCallback interface {
	OnDiscover(data []byte)
	OnWalletCreated(ok bool)
}

func DefaultCallback

func DefaultCallback() MotorCallback

type Peer

type Peer struct {
	PeerId string      `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	Did    string      `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"`
	Status Peer_Status `protobuf:"varint,3,opt,name=status,proto3,enum=sonrio.common.v1.Peer_Status" json:"status,omitempty"`
}

Basic Info Sent to Peers to Establish Connections

func (*Peer) Descriptor

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

func (*Peer) GetDid

func (m *Peer) GetDid() string

func (*Peer) GetPeerId

func (m *Peer) GetPeerId() string

func (*Peer) GetStatus

func (m *Peer) GetStatus() Peer_Status

func (*Peer) Marshal

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

func (*Peer) MarshalTo

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

func (*Peer) MarshalToSizedBuffer

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

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) Reset

func (m *Peer) Reset()

func (*Peer) Size

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

func (*Peer) String

func (m *Peer) String() string

func (*Peer) Unmarshal

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

func (*Peer) XXX_DiscardUnknown

func (m *Peer) XXX_DiscardUnknown()

func (*Peer) XXX_Marshal

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

func (*Peer) XXX_Merge

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

func (*Peer) XXX_Size

func (m *Peer) XXX_Size() int

func (*Peer) XXX_Unmarshal

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

type Peer_Status

type Peer_Status int32

Peers Active Status

const (
	Peer_STATUS_UNSPECIFIED Peer_Status = 0
	Peer_STATUS_ONLINE      Peer_Status = 1
	Peer_STATUS_AWAY        Peer_Status = 2
	Peer_STATUS_BUSY        Peer_Status = 3
)

func (Peer_Status) EnumDescriptor

func (Peer_Status) EnumDescriptor() ([]byte, []int)

func (Peer_Status) String

func (x Peer_Status) String() string

Jump to

Keyboard shortcuts

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