Documentation
¶
Index ¶
- Variables
- func GetLatestIPAddress(history []*supernodetypes.IPAddressHistory) string
- func GetLatestState(states []*supernodetypes.SuperNodeStateRecord) *supernodetypes.SuperNodeState
- type Action
- type ActionMetadata
- type ActionResult
- type ActionState
- type ActionType
- type CascadeMetadata
- type CascadeResult
- type DownloadResult
- type SenseMetadata
- type SuperNode
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidConfig is returned when configuration is invalid ErrInvalidConfig = errors.New("invalid configuration") // ErrNotFound is returned when a resource is not found ErrNotFound = errors.New("not found") // ErrTimeout is returned when an operation times out ErrTimeout = errors.New("operation timed out") // ErrInvalidSignature is returned when a signature is invalid ErrInvalidSignature = errors.New("invalid signature") // ErrTaskFailed is returned when a task fails ErrTaskFailed = errors.New("task failed") )
Functions ¶
func GetLatestIPAddress ¶
func GetLatestIPAddress(history []*supernodetypes.IPAddressHistory) string
GetLatestIPAddress extracts the IP address with the highest height from IPAddressHistory
func GetLatestState ¶
func GetLatestState(states []*supernodetypes.SuperNodeStateRecord) *supernodetypes.SuperNodeState
GetLatestState extracts the state with the highest height from SuperNodeStateRecord
Types ¶
type Action ¶
type Action struct {
ID string
Creator string
AppPubkey []byte
Type ActionType
State ActionState
Metadata ActionMetadata
Price string
ExpirationTime time.Time
BlockHeight int64
FileSizeKbs int64
SuperNodes []string
}
Action represents an action in the SDK
func ActionFromProto ¶
func ActionFromProto(pb *actiontypes.Action) *Action
ActionFromProto converts a proto action to SDK action
type ActionMetadata ¶
type ActionMetadata interface {
Type() ActionType
}
ActionMetadata is an interface for different action metadata types
type ActionResult ¶
ActionResult contains the result of an action registration
type ActionState ¶
type ActionState string
ActionState represents the state of an action
const ( ActionStatePending ActionState = "ACTION_STATE_PENDING" ActionStateProcessing ActionState = "ACTION_STATE_PROCESSING" ActionStateDone ActionState = "ACTION_STATE_DONE" ActionStateApproved ActionState = "ACTION_STATE_APPROVED" ActionStateFailed ActionState = "ACTION_STATE_FAILED" ActionStateExpired ActionState = "ACTION_STATE_EXPIRED" )
type ActionType ¶
type ActionType string
ActionType represents the type of action
const ( ActionTypeCascade ActionType = "CASCADE" ActionTypeSense ActionType = "SENSE" )
type CascadeMetadata ¶
type CascadeMetadata struct {
DataHash string
FileName string
RQIDsIC uint64
RQIDsMax uint64
RQIDsIDs []string
Signatures string
Public bool
}
CascadeMetadata contains cascade-specific metadata
func (*CascadeMetadata) Type ¶
func (m *CascadeMetadata) Type() ActionType
type CascadeResult ¶
type CascadeResult struct {
ActionResult
TaskID string
}
CascadeResult contains the result of a cascade operation
type DownloadResult ¶
DownloadResult contains the result of a download operation
type SenseMetadata ¶
type SenseMetadata struct {
DataHash string
CollectionID string
GroupID string
DDAndFingerprintsIC uint64
DDAndFingerprintsMax uint64
DDAndFingerprintsIDs []string
Signatures string
}
SenseMetadata contains sense-specific metadata
func (*SenseMetadata) Type ¶
func (m *SenseMetadata) Type() ActionType
type SuperNode ¶
SuperNode represents a supernode in the SDK
func SuperNodeFromProto ¶
func SuperNodeFromProto(pb *supernodetypes.SuperNode) *SuperNode
SuperNodeFromProto converts a proto supernode to SDK supernode