frostfs-node/pkg/local_object_storage/shard/id.go
Leonard Lyubich 383c483be7 [#176] localstore: Draft storage engine shard structure and ops
Implement the primary structure and operation of the local object
storage shard.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-11 17:19:37 +03:00

21 lines
388 B
Go

package shard
// ID represents Shard identifier.
//
// Each shard should have the unique ID within
// a single instance of local storage.
type ID []byte
// NewIDFromBytes constructs ID from byte slice.
func NewIDFromBytes(v []byte) *ID {
return (*ID)(&v)
}
func (id ID) String() string {
return string(id)
}
// ID returns Shard identifier.
func (s *Shard) ID() *ID {
return s.id
}