Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyPublicKeys is returned when no HCS keys are provided. ErrEmptyPublicKeys = errors.New("HCS public keys could not be empty") // ErrEmptyBearerToken is returned when no bearer token is provided. ErrEmptyBearerToken = errors.New("Bearer token could not be empty") )
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials interface { GetBox(context.Context, oid.Address) (*accessbox.Box, error) Put(context.Context, cid.ID, user.ID, *accessbox.AccessBox, uint64, ...*keys.PublicKey) (oid.Address, error) }
Credentials is a bearer token get/put interface.
func New ¶
func New(neoFS NeoFS, key *keys.PrivateKey, config *cache.Config) Credentials
New creates a new Credentials instance using the given cli and key.
type NeoFS ¶ added in v0.19.0
type NeoFS interface { // CreateObject creates and saves a parameterized object in the specified // NeoFS container from a specific user. It sets 'Timestamp' attribute to the current time. // It returns the ID of the saved object. // // It returns exactly one non-nil value. It returns any error encountered which // prevented the object from being created. CreateObject(context.Context, PrmObjectCreate) (oid.ID, error) // ReadObjectPayload reads payload of the object from NeoFS network by address // into memory. // // It returns exactly one non-nil value. It returns any error encountered which // prevented the object payload from being read. ReadObjectPayload(context.Context, oid.Address) ([]byte, error) }
NeoFS represents virtual connection to NeoFS network.
type PrmObjectCreate ¶ added in v0.19.0
type PrmObjectCreate struct { // NeoFS identifier of the object creator. Creator user.ID // NeoFS container to store the object. Container cid.ID // File path. Filepath string // Last NeoFS epoch of the object lifetime. ExpirationEpoch uint64 // Object payload. Payload []byte }
PrmObjectCreate groups parameters of objects created by credential tool.
Click to show internal directories.
Click to hide internal directories.