Documentation
¶
Index ¶
- type IndexedSignature
- type Meta
- func (m *Meta) Height() uint32
- func (m *Meta) MagicNumber() uint32
- func (m *Meta) NotifyObjectSuccess(ch chan<- struct{}, obj object.Object, h util.Uint256)
- func (m *Meta) PutObjects(o []*object.Object) error
- func (m *Meta) Run(ctx context.Context) error
- func (m *Meta) Search(cID cid.ID, fs []objectcore.SearchFilter, attrs []string, ...) ([]client.SearchResultItem, []byte, error)
- func (m *Meta) SubmitObjectPut(tx *transaction.Transaction, signatures [][]IndexedSignature) error
- func (m *Meta) TransactionTestInvocation(tx *transaction.Transaction) error
- func (m *Meta) UnsubscribeFromObject(addr oid.Address)
- type MetaChain
- type NeoFSNetwork
- type Parameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexedSignature ¶ added in v0.54.0
type IndexedSignature struct {
Index uint8
Signature neofscrypto.Signature
}
IndexedSignature is indexed signature, pointing at place of signature's public keys in a sorted (by these public keys) placement vector. It will be used as an optimized signatures check.
type Meta ¶
type Meta struct {
// contains filtered or unexported fields
}
Meta handles object meta information received from metadata chain and object storages. It must be created using New.
func New ¶
func New(p Parameters) (*Meta, error)
New makes Meta using Parameters. metabase.DB is created, opened and inited when called.
func (*Meta) MagicNumber ¶ added in v0.54.0
MagicNumber returns metadata chain's magic number.
func (*Meta) NotifyObjectSuccess ¶ added in v0.46.1
NotifyObjectSuccess subscribes channel for object notification chain inclusion. Channel must be read before subscription is made and writing to it must be non-blocking.
func (*Meta) PutObjects ¶ added in v0.54.0
PutObjects forces Meta to index provided objects.
func (*Meta) Run ¶
Run starts notification handling. Must be called only on instances created with New. Blocked until context is done. Cancelling the context stops the service.
func (*Meta) Search ¶ added in v0.46.0
func (m *Meta) Search(cID cid.ID, fs []objectcore.SearchFilter, attrs []string, cursor *objectcore.SearchCursor, count uint16) ([]client.SearchResultItem, []byte, error)
Search selects up to count container's objects from the given container matching the specified filters.
func (*Meta) SubmitObjectPut ¶ added in v0.54.0
func (m *Meta) SubmitObjectPut(tx *transaction.Transaction, signatures [][]IndexedSignature) error
SubmitObjectPut sends transaction to metadata chain. Transaction must be completed excepting transaction.Witness.InvocationScript that will be filled using provided signatures. signatures must be a two two-dimensional array that corresponds to placement vectors for a container that tx was made for. Signature optimized sorting is not this func's responsibility.
func (*Meta) TransactionTestInvocation ¶ added in v0.54.0
func (m *Meta) TransactionTestInvocation(tx *transaction.Transaction) error
TransactionTestInvocation validates transaction.
func (*Meta) UnsubscribeFromObject ¶ added in v0.46.1
UnsubscribeFromObject unsibscribes from object notification. Should be called if notification is not required as a memory clean up.
type MetaChain ¶ added in v0.54.0
type MetaChain interface {
// Magic must return metadata chain magic number.
Magic() uint32
// Height must return actual chain height.
Height() uint32
// AddTx must add transaction to the chain without blocking.
AddTx(tx *transaction.Transaction) error
// SubscribeForBlocks must subscribe for new block headers.
// Block shouldbe sent to provided channel.
SubscribeForBlocks(ch chan *block.Header)
// SubscribeForNotifications must subscribe for new chain notifications.
// Notifications should be sent to provided channel.
SubscribeForNotifications(ch chan *state.ContainedNotificationEvent)
// TransactionTestInvocation must validate transaction execution
// without persisting it.
TransactionTestInvocation(tx *transaction.Transaction) error
}
MetaChain describes metadata chain.
type NeoFSNetwork ¶ added in v0.45.2
type NeoFSNetwork interface {
// Head returns actual object header from the NeoFS network (non-local
// objects should also be returned). Missing, removed object statuses
// must be reported according to API statuses from SDK.
Head(context.Context, cid.ID, oid.ID) (object.Object, error)
// IsMineWithMeta checks if the given container has meta enabled and current
// node belongs to it.
IsMineWithMeta(cid.ID, []byte) (bool, error)
}
NeoFSNetwork describes current NeoFS storage network state.
type Parameters ¶
type Parameters struct {
Logger *zap.Logger
Chain MetaChain
Path string
Network NeoFSNetwork
FlushBatchInterval time.Duration
}
Parameters groups arguments for New call. Logger, Chain and Network must not be nil, path must not be empty.