marker

package
v1.18.15 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Methods and types to interact with Read and Write Markers. Read and Write Markers are the representation of the read and write operations, and a means by which the blobber is paid for storage cost. Write markers also are used to determine the latest allocation version.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthTicket

type AuthTicket struct {
	ClientID            string `json:"client_id"`
	OwnerID             string `json:"owner_id"`
	AllocationID        string `json:"allocation_id"`
	FilePathHash        string `json:"file_path_hash"`
	ActualFileHash      string `json:"actual_file_hash"`
	FileName            string `json:"file_name"`
	RefType             string `json:"reference_type"`
	Expiration          int64  `json:"expiration"`
	Timestamp           int64  `json:"timestamp"`
	ReEncryptionKey     string `json:"re_encryption_key,omitempty"`
	Encrypted           bool   `json:"encrypted"`
	Signature           string `json:"signature"`
	EncryptionPublicKey string `json:"encryption_public_key"`
}

AuthTicket authentication ticket for file sharing. AuthTicket is used to provide access to a file or directory by non-owner clients. It's generated by the owner client and signed with their wallet's private key. Then shared with the non-owner client to be able to access the shared file or directory.

func (*AuthTicket) GetHashData

func (at *AuthTicket) GetHashData() string

NewAuthTicket returns the MPT hash of the AuthTicket

func (*AuthTicket) Sign

func (at *AuthTicket) Sign() error

Sign signs the AuthTicket

type DeleteToken

type DeleteToken struct {
	FilePathHash string `json:"file_path_hash"`
	FileRefHash  string `json:"file_ref_hash"`
	AllocationID string `json:"allocation_id"`
	Size         int64  `json:"size"`
	BlobberID    string `json:"blobber_id"`
	Timestamp    int64  `json:"timestamp"`
	ClientID     string `json:"client_id"`
	Signature    string `json:"signature"`
}

func (*DeleteToken) GetHash

func (dt *DeleteToken) GetHash() string

func (*DeleteToken) Sign

func (dt *DeleteToken) Sign() error

type ReadMarker

type ReadMarker struct {
	ClientID        string           `json:"client_id"`
	ClientPublicKey string           `json:"client_public_key"`
	BlobberID       string           `json:"blobber_id"`
	AllocationID    string           `json:"allocation_id"`
	OwnerID         string           `json:"owner_id"`
	Timestamp       common.Timestamp `json:"timestamp"`
	ReadCounter     int64            `json:"counter"`
	Signature       string           `json:"signature"`
	SessionRC       int64            `json:"session_rc"`
}

func (*ReadMarker) GetHash

func (rm *ReadMarker) GetHash() string

func (*ReadMarker) Sign

func (rm *ReadMarker) Sign() error

func (*ReadMarker) ValidateWithOtherRM added in v1.8.2

func (rm *ReadMarker) ValidateWithOtherRM(rm1 *ReadMarker) error

ValidateWithOtherRM will validate rm1 assuming rm is valid. It checks parameters equality and validity of signature

type WriteMarker

type WriteMarker struct {
	AllocationRoot         string `json:"allocation_root"`
	PreviousAllocationRoot string `json:"prev_allocation_root"`
	FileMetaRoot           string `json:"file_meta_root"`
	AllocationID           string `json:"allocation_id"`
	Size                   int64  `json:"size"`
	ChainSize              int64  `json:"chain_size"`
	ChainHash              string `json:"chain_hash"`
	ChainLength            int    `json:"chain_length"`
	BlobberID              string `json:"blobber_id"`
	Timestamp              int64  `json:"timestamp"`
	ClientID               string `json:"client_id"`
	Signature              string `json:"signature"`
}

func (*WriteMarker) GetHash

func (wm *WriteMarker) GetHash() string

func (*WriteMarker) GetHashData

func (wm *WriteMarker) GetHashData() string

func (*WriteMarker) Sign

func (wm *WriteMarker) Sign() error

func (*WriteMarker) VerifySignature

func (wm *WriteMarker) VerifySignature(clientPublicKey string) error

Jump to

Keyboard shortcuts

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