types

package
v1.3.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CodeMessageTooLarge     sdk.CodeType = 101
	CodeTopicExists         sdk.CodeType = 102
	CodeTopicNotFound       sdk.CodeType = 103
	CodeWriterExists        sdk.CodeType = 104
	CodeWriterNotFound      sdk.CodeType = 104
	CodeWriterNotAuthorized sdk.CodeType = 105
	CodeInvalidTopic        sdk.CodeType = 106
	CodeInvalidMoniker      sdk.CodeType = 107
)
View Source
const (
	// module name
	ModuleName = "aol"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey to be used in router
	RouterKey = ModuleName

	// QuerierRoute is the query router key
	QuerierRoute = ModuleName
)
View Source
const (
	MaxTopicLength       = 70
	MaxMonikerLength     = 70
	MaxDescriptionLength = 5000
	MaxRecordKeyLength   = 70
	MaxRecordValueLength = 5000
)
View Source
const (
	QueryListTopic  = "listTopic"
	QueryTopic      = "topic"
	QueryListWriter = "listWriter"
	QueryWriter     = "writer"
	QueryRecord     = "record"
)

query endpoints supported by the aol querier

View Source
const DefaultCodespace sdk.CodespaceType = ModuleName

Variables

View Source
var ModuleCdc *codec.Codec

ModuleCdc generic sealed codec to be used throughout module

Functions

func ErrInvalidMoniker added in v1.3.1

func ErrInvalidMoniker(moniker string) sdk.Error

func ErrInvalidTopic added in v1.3.1

func ErrInvalidTopic(topic string) sdk.Error

func ErrMessageTooLarge

func ErrMessageTooLarge(descriptor string, got, max int) sdk.Error

func ErrTopicExists

func ErrTopicExists(topic string) sdk.Error

func ErrTopicNotFound

func ErrTopicNotFound(topic string) sdk.Error

func ErrWriterExists

func ErrWriterExists(writer sdk.AccAddress) sdk.Error

func ErrWriterNotAuthorized

func ErrWriterNotAuthorized(writer sdk.AccAddress) sdk.Error

func ErrWriterNotFound

func ErrWriterNotFound(writer sdk.AccAddress) sdk.Error

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on Amino codec

func ValidateGenesis added in v1.3.1

func ValidateGenesis(data GenesisState) error

Types

type GenesisOwnerKey added in v1.3.1

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

GenesisOwnerKey

func (GenesisOwnerKey) Marshal added in v1.3.1

func (k GenesisOwnerKey) Marshal() string

func (*GenesisOwnerKey) Unmarshal added in v1.3.1

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

type GenesisRecordKey added in v1.3.1

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

GenesisRecordKey

func (GenesisRecordKey) Marshal added in v1.3.1

func (k GenesisRecordKey) Marshal() string

func (*GenesisRecordKey) Unmarshal added in v1.3.1

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

type GenesisState added in v1.3.1

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

func DefaultGenesisState added in v1.3.1

func DefaultGenesisState() GenesisState

type GenesisTopicKey added in v1.3.1

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

GenesisTopicKey

func (GenesisTopicKey) Marshal added in v1.3.1

func (k GenesisTopicKey) Marshal() string

func (*GenesisTopicKey) Unmarshal added in v1.3.1

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

type GenesisWriterKey added in v1.3.1

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

GenesisWriterKey

func (GenesisWriterKey) Marshal added in v1.3.1

func (k GenesisWriterKey) Marshal() string

func (*GenesisWriterKey) Unmarshal added in v1.3.1

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

type MsgAddRecord

type MsgAddRecord struct {
	TopicName       string         `json:"topic_name"`
	Key             []byte         `json:"key"`
	Value           []byte         `json:"value"`
	WriterAddress   sdk.AccAddress `json:"writer_address"`
	OwnerAddress    sdk.AccAddress `json:"owner_address"`
	FeePayerAddress sdk.AccAddress `json:"fee_payer_address"`
}

MsgAddRecord

func (MsgAddRecord) GetSignBytes

func (msg MsgAddRecord) GetSignBytes() []byte

func (MsgAddRecord) GetSigners

func (msg MsgAddRecord) GetSigners() []sdk.AccAddress

func (MsgAddRecord) Route

func (msg MsgAddRecord) Route() string

func (MsgAddRecord) Type

func (msg MsgAddRecord) Type() string

func (MsgAddRecord) ValidateBasic

func (msg MsgAddRecord) ValidateBasic() sdk.Error

type MsgAddWriter

type MsgAddWriter struct {
	TopicName     string         `json:"topic_name"`
	Moniker       string         `json:"moniker"`
	Description   string         `json:"description"`
	WriterAddress sdk.AccAddress `json:"writer_address"`
	OwnerAddress  sdk.AccAddress `json:"owner_address"`
}

MsgAddWriter

func (MsgAddWriter) GetSignBytes

func (msg MsgAddWriter) GetSignBytes() []byte

func (MsgAddWriter) GetSigners

func (msg MsgAddWriter) GetSigners() []sdk.AccAddress

func (MsgAddWriter) Route

func (msg MsgAddWriter) Route() string

func (MsgAddWriter) Type

func (msg MsgAddWriter) Type() string

func (MsgAddWriter) ValidateBasic

func (msg MsgAddWriter) ValidateBasic() sdk.Error

type MsgCreateTopic

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

MsgCreateTopic

func (MsgCreateTopic) GetSignBytes

func (msg MsgCreateTopic) GetSignBytes() []byte

func (MsgCreateTopic) GetSigners

func (msg MsgCreateTopic) GetSigners() []sdk.AccAddress

func (MsgCreateTopic) Route

func (msg MsgCreateTopic) Route() string

func (MsgCreateTopic) Type

func (msg MsgCreateTopic) Type() string

func (MsgCreateTopic) ValidateBasic

func (msg MsgCreateTopic) ValidateBasic() sdk.Error

type MsgDeleteWriter

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

MsgDeleteWriter

func (MsgDeleteWriter) GetSignBytes

func (msg MsgDeleteWriter) GetSignBytes() []byte

func (MsgDeleteWriter) GetSigners

func (msg MsgDeleteWriter) GetSigners() []sdk.AccAddress

func (MsgDeleteWriter) Route

func (msg MsgDeleteWriter) Route() string

func (MsgDeleteWriter) Type

func (msg MsgDeleteWriter) Type() string

func (MsgDeleteWriter) ValidateBasic

func (msg MsgDeleteWriter) ValidateBasic() sdk.Error

type Owner

type Owner struct {
	TotalTopics uint64 `json:"total_topics"`
}

func NewOwner

func NewOwner() Owner

func (Owner) IncreaseTotalTopics

func (o Owner) IncreaseTotalTopics() Owner

func (Owner) String

func (o Owner) String() string

type QueryListTopicParams added in v1.3.1

type QueryListTopicParams struct {
	Owner sdk.AccAddress
}

func NewQueryListTopicParams added in v1.3.1

func NewQueryListTopicParams(owner sdk.AccAddress) *QueryListTopicParams

type QueryListWriterParams added in v1.3.1

type QueryListWriterParams struct {
	Owner     sdk.AccAddress
	TopicName string
}

func NewQueryListWriterParams added in v1.3.1

func NewQueryListWriterParams(owner sdk.AccAddress, topicName string) *QueryListWriterParams

type QueryRecordParams added in v1.3.1

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

func NewQueryRecordParams added in v1.3.1

func NewQueryRecordParams(owner sdk.AccAddress, topicName string, offset uint64) *QueryRecordParams

type QueryTopicParams added in v1.3.1

type QueryTopicParams struct {
	Owner     sdk.AccAddress
	TopicName string
}

func NewQueryTopicParams added in v1.3.1

func NewQueryTopicParams(owner sdk.AccAddress, topicName string) *QueryTopicParams

type QueryWriterParams added in v1.3.1

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

func NewQueryWriterParams added in v1.3.1

func NewQueryWriterParams(owner sdk.AccAddress, topicName string, writer sdk.AccAddress) *QueryWriterParams

type Record

type Record struct {
	Key           []byte         `json:"key"`
	Value         []byte         `json:"value"`
	NanoTimestamp int64          `json:"nano_timestamp"`
	WriterAddress sdk.AccAddress `json:"writer_address"`
}

func NewRecord

func NewRecord(key []byte, value []byte, nanoTimestamp int64, writer sdk.AccAddress) Record

func (Record) IsEmpty

func (r Record) IsEmpty() bool

func (Record) String

func (r Record) String() string

type ResAddRecord

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

func NewMsgAddRecordResponse

func NewMsgAddRecordResponse(owner sdk.AccAddress, topic string, offset uint64) ResAddRecord

func (ResAddRecord) MustMarshalJSON

func (r ResAddRecord) MustMarshalJSON() []byte

type Topic

type Topic struct {
	Description  string `json:"description"`
	TotalRecords uint64 `json:"total_records"`
	TotalWriters uint64 `json:"total_writers"`
}

func NewTopic

func NewTopic(description string) Topic

func (Topic) DecreaseTotalWriters

func (t Topic) DecreaseTotalWriters() Topic

func (Topic) IncreaseTotalRecords

func (t Topic) IncreaseTotalRecords() Topic

func (Topic) IncreaseTotalWriters

func (t Topic) IncreaseTotalWriters() Topic

func (Topic) NextRecordOffset

func (t Topic) NextRecordOffset() uint64

func (Topic) String

func (t Topic) String() string

type Topics

type Topics []string

func (Topics) String

func (t Topics) String() (out string)

type Writer

type Writer struct {
	Moniker       string `json:"moniker"`
	Description   string `json:"description"`
	NanoTimestamp int64  `json:"nano_timestamp"`
}

func NewWriter

func NewWriter(moniker string, description string, nanoTimestamp int64) Writer

func (Writer) String

func (w Writer) String() string

type Writers

type Writers []string

func (Writers) String

func (w Writers) String() (out string)

Jump to

Keyboard shortcuts

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