aol

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName   = types.ModuleName
	StoreKey     = types.StoreKey
	RouterKey    = types.RouterKey
	QuerierRoute = types.QuerierRoute
)
View Source
const (
	QueryListTopic  = "listTopic"
	QueryTopic      = "topic"
	QueryListWriter = "listWriter"
	QueryWriter     = "writer"
	QueryRecord     = "record"
)

query endpoints supported by the aol querier

Variables

View Source
var (
	KeyDelimiter = []byte{0x00}

	OwnerKeyPrefix  = []byte{0x11} // {Prefix}{Owner}
	TopicKeyPrefix  = []byte{0x12} // {Prefix}{Owner}{Topic}
	ACLWriterPrefix = []byte{0x13} // {Prefix}{Owner}{Topic}{Writer}
	RecordKeyPrefix = []byte{0x14} // {Prefix}{Owner}{Topic}{Offset}
)
View Source
var (
	RegisterCodec = types.RegisterCodec
)

Functions

func ACLWriterKey

func ACLWriterKey(ownerAddr sdk.AccAddress, topic string, writerAddr sdk.Address) []byte

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "aol" type messages

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func OwnerKey

func OwnerKey(ownerAddr sdk.AccAddress) []byte

func RecordKey

func RecordKey(ownerAddr sdk.AccAddress, topic string, offset uint64) []byte

func TopicKey

func TopicKey(ownerAddr sdk.AccAddress, topic string) []byte

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type GenesisOwnerKey

type GenesisOwnerKey struct {
	OwnerAddress sdk.AccAddress `json:"owner_address"`
}

GenesisOwnerKey

func (GenesisOwnerKey) Marshal

func (k GenesisOwnerKey) Marshal() string

func (*GenesisOwnerKey) Unmarshal

func (k *GenesisOwnerKey) Unmarshal(key string) error

type GenesisRecordKey

type GenesisRecordKey struct {
	OwnerAddress sdk.AccAddress `json:"owner_address"`
	TopicName    string         `json:"topic_name"`
	Offset       uint64         `json:"offset"`
}

GenesisRecordKey

func (GenesisRecordKey) Marshal

func (k GenesisRecordKey) Marshal() string

func (*GenesisRecordKey) Unmarshal

func (k *GenesisRecordKey) Unmarshal(key string) error

type GenesisState

type GenesisState struct {
	Owners  map[string]types.Owner  `json:"owners"`
	Topics  map[string]types.Topic  `json:"topics"`
	Writers map[string]types.Writer `json:"writers"`
	Records map[string]types.Record `json:"records"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState

type GenesisTopicKey

type GenesisTopicKey struct {
	OwnerAddress sdk.AccAddress `json:"owner_address"`
	TopicName    string         `json:"topic_name"`
}

GenesisTopicKey

func (GenesisTopicKey) Marshal

func (k GenesisTopicKey) Marshal() string

func (*GenesisTopicKey) Unmarshal

func (k *GenesisTopicKey) Unmarshal(key string) error

type GenesisWriterKey

type GenesisWriterKey struct {
	OwnerAddress  sdk.AccAddress `json:"owner_address"`
	TopicName     string         `json:"topic_name"`
	WriterAddress sdk.AccAddress `json:"writer_address"`
}

GenesisWriterKey

func (GenesisWriterKey) Marshal

func (k GenesisWriterKey) Marshal() string

func (*GenesisWriterKey) Unmarshal

func (k *GenesisWriterKey) Unmarshal(key string) error

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec) Keeper

NewKeeper creates new instances of the aol Keeper

func (Keeper) DeleteWriter

func (k Keeper) DeleteWriter(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string, writerAddr sdk.AccAddress)

func (Keeper) GetOwner

func (k Keeper) GetOwner(ctx sdk.Context, ownerAddr sdk.AccAddress) types.Owner

func (Keeper) GetRecord

func (k Keeper) GetRecord(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string, offset uint64) types.Record

func (Keeper) GetTopic

func (k Keeper) GetTopic(ctx sdk.Context, ownerAddr sdk.AccAddress, topicName string) types.Topic

func (Keeper) GetWriter

func (k Keeper) GetWriter(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string, writerAddr sdk.AccAddress) types.Writer

func (Keeper) HasRecord

func (k Keeper) HasRecord(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string, offset uint64) bool

func (Keeper) HasTopic

func (k Keeper) HasTopic(ctx sdk.Context, ownerAddr sdk.AccAddress, topicName string) bool

func (Keeper) HasWriter

func (k Keeper) HasWriter(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string, writerAddr sdk.AccAddress) bool

func (Keeper) ListOwner

func (k Keeper) ListOwner(ctx sdk.Context) []sdk.AccAddress

func (Keeper) ListTopic

func (k Keeper) ListTopic(ctx sdk.Context, ownerAddr sdk.AccAddress) []string

func (Keeper) ListWriter

func (k Keeper) ListWriter(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string) []sdk.AccAddress

TODO Max Retrieve

func (Keeper) SetOwner

func (k Keeper) SetOwner(ctx sdk.Context, ownerAddr sdk.AccAddress, owner types.Owner)

func (Keeper) SetRecord

func (k Keeper) SetRecord(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string, offset uint64, record types.Record)

func (Keeper) SetTopic

func (k Keeper) SetTopic(ctx sdk.Context, ownerAddr sdk.AccAddress, topicName string, topic types.Topic)

func (Keeper) SetWriter

func (k Keeper) SetWriter(ctx sdk.Context, ownerAddr sdk.AccAddress, topic string, writerAddr sdk.AccAddress, writer types.Writer)

type MsgAddRecord

type MsgAddRecord = types.MsgAddRecord

type MsgAddWriter

type MsgAddWriter = types.MsgAddWriter

type MsgCreateTopic

type MsgCreateTopic = types.MsgCreateTopic

type MsgDeleteWriter

type MsgDeleteWriter = types.MsgDeleteWriter

type QueryListTopicParams

type QueryListTopicParams struct {
	Owner sdk.AccAddress
}

type QueryListWriterParams

type QueryListWriterParams struct {
	Owner     sdk.AccAddress
	TopicName string
}

type QueryRecordParams

type QueryRecordParams struct {
	Owner     sdk.AccAddress
	TopicName string
	Offset    uint64
}

type QueryTopicParams

type QueryTopicParams struct {
	Owner     sdk.AccAddress
	TopicName string
}

type QueryWriterParams

type QueryWriterParams struct {
	Owner     sdk.AccAddress
	TopicName string
	Writer    sdk.AccAddress
}

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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