object

package
v0.42.9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "object",
	Short: "Operations with Objects",
	Long:  `Operations with Objects`,
	PersistentPreRun: func(cmd *cobra.Command, _ []string) {

		commonflags.Bind(cmd)
		commonflags.BindAPI(cmd)
	},
}

Cmd represents the object command.

Functions

func InitBearer

func InitBearer(cmd *cobra.Command)

InitBearer adds bearer token flag to a command.

func OpenSession

func OpenSession(cmd *cobra.Command, dst SessionPrm, key *ecdsa.PrivateKey, cnr cid.ID, obj *oid.ID)

OpenSession opens client connection and calls OpenSessionViaClient with it.

func OpenSessionViaClient

func OpenSessionViaClient(cmd *cobra.Command, dst SessionPrm, cli *client.Client, key *ecdsa.PrivateKey, cnr cid.ID, obj *oid.ID)

OpenSessionViaClient opens object session with the remote node, finalizes structure of the session token and writes the result into the provided SessionPrm. Also writes provided client connection to the SessionPrm.

SessionPrm MUST be one of:

*internal.PutObjectPrm
*internal.DeleteObjectPrm

If provided SessionPrm is of type internal.DeleteObjectPrm, OpenSessionViaClient spreads the session to all object's relatives.

func Prepare

func Prepare(cmd *cobra.Command, prms ...RPCParameters)

Prepare prepares object-related parameters for a command.

func ReadOrOpenSession

func ReadOrOpenSession(cmd *cobra.Command, dst SessionPrm, key *ecdsa.PrivateKey, cnr cid.ID, obj *oid.ID)

ReadOrOpenSession opens client connection and calls ReadOrOpenSessionViaClient with it.

func ReadOrOpenSessionViaClient

func ReadOrOpenSessionViaClient(cmd *cobra.Command, dst SessionPrm, cli *client.Client, key *ecdsa.PrivateKey, cnr cid.ID, obj *oid.ID)

ReadOrOpenSessionViaClient tries to read session from the file specified in commonflags.SessionToken flag, finalizes structures of the decoded token and write the result into provided SessionPrm. If file is missing, ReadOrOpenSessionViaClient calls OpenSessionViaClient.

Types

type ObjNodesDataObject added in v0.39.0

type ObjNodesDataObject struct {
	ObjectID         string   `json:"object_id"`
	RequiredNodes    []string `json:"required_nodes,omitempty"`
	ConfirmedNodes   []string `json:"confirmed_nodes,omitempty"`
	ECParentObjectID *string  `json:"ec_parent_object_id,omitempty"`
	ECIndex          *uint32  `json:"ec_index,omitempty"`
}

type RPCParameters

type RPCParameters interface {
	SetBearerToken(prm *bearer.Token)
	SetTTL(uint32)
	SetXHeaders([]string)
}

type SessionPrm

type SessionPrm interface {
	SetSessionToken(*session.Object)
	SetClient(*client.Client)
}

SessionPrm is a common interface of object operation's input which supports sessions.

Jump to

Keyboard shortcuts

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