object

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BearerTokenFlag is a flag for bearer token widely used across object
	// commands.
	BearerTokenFlag = "bearer"
)

Variables

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

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

Cmd represents the object command.

Functions

func CreateSessionV2 added in v0.51.0

func CreateSessionV2(ctx context.Context, cmd *cobra.Command, dst SessionPrm, cli *client.Client, key *ecdsa.PrivateKey, subjects []sessionv2.Target, cnr cid.ID) error

CreateSessionV2 opens object session with the remote node, finalizes structure of the session token v2 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

func InitBearer

func InitBearer(cmd *cobra.Command)

InitBearer adds bearer token flag to a command.

func ParseXHeaders added in v0.45.0

func ParseXHeaders(cmd *cobra.Command) []string

ParseXHeaders parses comma-separated 'key=value' pairs from '--xhdr' flags.

func Prepare

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

Prepare prepares object-related parameters for a command.

func ReadOrOpenSessionViaClient added in v0.34.0

func ReadOrOpenSessionViaClient(ctx context.Context, cmd *cobra.Command, dst SessionPrm, cli *client.Client, key *ecdsa.PrivateKey, subjects []sessionv2.Target, cnr cid.ID, objs ...oid.ID) error

ReadOrOpenSessionViaClient tries to read session from the file (V2 first, then V1), specified in commonflags.SessionToken flag, finalizes structures of the decoded token and write the result into provided SessionPrm. If file is missing, CreateSessionV2 is called to create V2 token.

Types

type RPCParameters

type RPCParameters interface {
	WithBearerToken(bearer.Token)
	WithXHeaders(...string)
}

type SessionPrm added in v0.34.0

type SessionPrm interface {
	WithinSession(session.Object)
	WithinSessionV2(sessionv2.Token)
}

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