keeper

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	spKeeper types.SpKeeper,

) *Keeper

func (Keeper) AddGroupMember

func (k Keeper) AddGroupMember(ctx sdk.Context, groupMemberInfo types.GroupMemberInfo) error

func (Keeper) Bucket

func (Keeper) CheckSPAndSignature

func (k Keeper) CheckSPAndSignature(ctx sdk.Context, spAddrs []string, sigData [][]byte, signature [][]byte) error

func (Keeper) CreateBucket

func (k Keeper) CreateBucket(ctx sdk.Context, bucketInfo types.BucketInfo) error

func (Keeper) CreateGroup

func (k Keeper) CreateGroup(ctx sdk.Context, groupInfo types.GroupInfo) error

func (Keeper) CreateObject

func (k Keeper) CreateObject(ctx sdk.Context, objectInfo types.ObjectInfo) error

func (Keeper) DeleteBucket

func (k Keeper) DeleteBucket(ctx sdk.Context, bucketName string) error

func (Keeper) DeleteGroup

func (k Keeper) DeleteGroup(ctx sdk.Context, ownerAddr string, groupName string) error

func (Keeper) DeleteObject

func (k Keeper) DeleteObject(ctx sdk.Context, bucketName string, objectName string)

func (Keeper) GetBucket

func (k Keeper) GetBucket(ctx sdk.Context, bucketName string) (bucketInfo types.BucketInfo, found bool)

func (Keeper) GetBucketId

func (k Keeper) GetBucketId(ctx sdk.Context) math.Uint

func (Keeper) GetGroup

func (k Keeper) GetGroup(ctx sdk.Context, ownerAddr string, groupName string) (groupInfo types.GroupInfo, found bool)

func (Keeper) GetGroupId

func (k Keeper) GetGroupId(ctx sdk.Context) math.Uint

func (Keeper) GetObject

func (k Keeper) GetObject(ctx sdk.Context, bucketName string, objectName string) (objectInfo types.ObjectInfo, found bool)

func (Keeper) GetObjectID

func (k Keeper) GetObjectID(ctx sdk.Context) math.Uint

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) HasGroupMember

func (k Keeper) HasGroupMember(ctx sdk.Context, groupMemberKey []byte) bool

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) MaxPayloadSize

func (k Keeper) MaxPayloadSize(ctx sdk.Context) (res uint64)

func (Keeper) MaxSegmentSize

func (k Keeper) MaxSegmentSize(ctx sdk.Context) (res uint64)

func (Keeper) MustGetBucket

func (k Keeper) MustGetBucket(ctx sdk.Context, bucketName string) (bucketInfo types.BucketInfo, found bool)

func (Keeper) Object

func (Keeper) Params

func (Keeper) RedundantDataChunkNum

func (k Keeper) RedundantDataChunkNum(ctx sdk.Context) (res uint32)

func (Keeper) RedundantParityChunkNum

func (k Keeper) RedundantParityChunkNum(ctx sdk.Context) (res uint32)

func (Keeper) RemoveGroupMember

func (k Keeper) RemoveGroupMember(ctx sdk.Context, groupId math.Uint, member string) error

func (Keeper) SetObject

func (k Keeper) SetObject(ctx sdk.Context, objectInfo types.ObjectInfo)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

type Sequence

type Sequence struct {
	// contains filtered or unexported fields
}

sequence is a persistent unique key generator based on a counter.

func NewSequence

func NewSequence(prefix []byte) Sequence

func (Sequence) CurVal

func (s Sequence) CurVal(store sdk.KVStore) math.Uint

CurVal returns the last value used. 0 if none.

func (Sequence) InitVal

func (s Sequence) InitVal(store sdk.KVStore, seq math.Uint) error

InitVal sets the start value for the sequence. It must be called only once on an empty DB. Otherwise an error is returned when the key exists. The given start value is stored as current value.

It is recommended to call this method only for a sequence start value other than `1` as the method consumes unnecessary gas otherwise. A scenario would be an import from genesis.

func (Sequence) NextVal

func (s Sequence) NextVal(store sdk.KVStore) math.Uint

NextVal increments and persists the counter by one and returns the value.

func (Sequence) PeekNextVal

func (s Sequence) PeekNextVal(store sdk.KVStore) math.Uint

PeekNextVal returns the CurVal + increment step. Not persistent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL