Documentation
¶
Index ¶
- Constants
- Variables
- func InitBearer(cmd *cobra.Command)
- func OpenSessionViaClient(ctx context.Context, cmd *cobra.Command, dst SessionPrm, cli *client.Client, ...) error
- func ParseXHeaders(cmd *cobra.Command) []string
- func Prepare(cmd *cobra.Command, prms ...RPCParameters) error
- func ReadOrOpenSessionViaClient(ctx context.Context, cmd *cobra.Command, dst SessionPrm, cli *client.Client, ...) error
- type RPCParameters
- type SessionPrm
Constants ¶
const ( // BearerTokenFlag is a flag for bearer token widely used across object // commands. BearerTokenFlag = "bearer" )
Variables ¶
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 InitBearer ¶
InitBearer adds bearer token flag to a command.
func OpenSessionViaClient ¶ added in v0.34.0
func OpenSessionViaClient(ctx context.Context, cmd *cobra.Command, dst SessionPrm, cli *client.Client, key *ecdsa.PrivateKey, cnr cid.ID, objs ...oid.ID) error
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
func ParseXHeaders ¶ added in v0.45.0
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, cnr cid.ID, objs ...oid.ID) error
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.