msgs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalOpMsg

type ApprovalOpMsg struct {
	OperationID     string `json:"operation_id"`
	OperationType   string `json:"operation_type"`
	TransactionHash string `json:"transaction_hash"`
}

func (ApprovalOpMsg) Message

func (m ApprovalOpMsg) Message() Message

type BlockRangeMessage

type BlockRangeMessage struct {
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

func (BlockRangeMessage) Message

func (br BlockRangeMessage) Message() Message

type CollectionCreatedMessage

type CollectionCreatedMessage struct {
	Index string `json:"index"`
}

func (CollectionCreatedMessage) Message

func (m CollectionCreatedMessage) Message() Message

type CollectionDataCreatedMessage

type CollectionDataCreatedMessage struct {
	CollectionIndex string `json:"index"`
	Chain           string `json:"chain"`
}

func (CollectionDataCreatedMessage) Message

type CollectionDataRemovedMessage

type CollectionDataRemovedMessage struct {
	CollectionIndex string `json:"index"`
	Chain           string `json:"chain"`
}

func (CollectionDataRemovedMessage) Message

type CollectionDataUpdatedMessage

type CollectionDataUpdatedMessage struct {
	CollectionIndex string `json:"index"`
	Chain           string `json:"chain"`
}

func (CollectionDataUpdatedMessage) Message

type CollectionRemovedMessage

type CollectionRemovedMessage struct {
	Index string `json:"index"`
}

func (CollectionRemovedMessage) Message

func (m CollectionRemovedMessage) Message() Message

type ConfirmationOpMsg

type ConfirmationOpMsg struct {
	ConfirmationID  string `json:"confirmation_id"`
	TransactionHash string `json:"transaction_hash"`
}

func (ConfirmationOpMsg) Message

func (m ConfirmationOpMsg) Message() Message

type Consumer

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

func NewConsumer

func NewConsumer(log *logan.Entry, cfg ConsumerConfig, handler Handler) *Consumer

func (*Consumer) Run

func (c *Consumer) Run(ctx context.Context)

type ConsumerConfig

type ConsumerConfig struct {
	Name                 string        `fig:"name"`
	Queue                string        `fig:"queue,required"`
	PrefetchLimit        int64         `fig:"prefetch_limit"`
	PollDuration         time.Duration `fig:"poll_duration"`
	MinRetryPeriod       time.Duration `fig:"min_retry_period"`
	MaxRetryPeriod       time.Duration `fig:"max_retry_period"`
	RetryConsumeAttempts uint64        `fig:"retry_consume_attempts"`
	RedisClient          *redis.Client `fig:"-"`
}

type Consumerer

type Consumerer interface {
	Consumer() ConsumerConfig
}

func NewConsumerer

func NewConsumerer(getter kv.Getter, name string, opts ConsumererOpts) Consumerer

type ConsumererOpts

type ConsumererOpts struct {
	RedisClient *redis.Client
}

type Handler

type Handler interface {
	Handle(ctx context.Context, msgs []Message) error
}

type ItemCreatedMessage

type ItemCreatedMessage struct {
	Index string `json:"index"`
}

func (ItemCreatedMessage) Message

func (m ItemCreatedMessage) Message() Message

type ItemOnChainDataCreatedMessage

type ItemOnChainDataCreatedMessage struct {
	ItemIndex string `json:"index"`
	Chain     string `json:"chain"`
}

func (ItemOnChainDataCreatedMessage) Message

type ItemOnChainDataRemovedMessage

type ItemOnChainDataRemovedMessage struct {
	ItemIndex string `json:"index"`
	Chain     string `json:"chain"`
}

func (ItemOnChainDataRemovedMessage) Message

type ItemRemovedMessage

type ItemRemovedMessage struct {
	Index string `json:"index"`
}

func (ItemRemovedMessage) Message

func (m ItemRemovedMessage) Message() Message

type Message

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

func (*Message) MustApprovalOpMessage

func (m *Message) MustApprovalOpMessage() (msg ApprovalOpMsg)

func (*Message) MustBlockRangeMessage

func (m *Message) MustBlockRangeMessage() (msg BlockRangeMessage)

func (*Message) MustCollectionCreatedMessage

func (m *Message) MustCollectionCreatedMessage() (msg CollectionCreatedMessage)

func (*Message) MustCollectionDataCreatedMessage

func (m *Message) MustCollectionDataCreatedMessage() (msg CollectionDataCreatedMessage)

func (*Message) MustCollectionDataRemovedMessage

func (m *Message) MustCollectionDataRemovedMessage() (msg CollectionDataRemovedMessage)

func (*Message) MustCollectionDataUpdatedMessage

func (m *Message) MustCollectionDataUpdatedMessage() (msg CollectionDataUpdatedMessage)

func (*Message) MustCollectionRemovedMessage

func (m *Message) MustCollectionRemovedMessage() (msg CollectionRemovedMessage)

func (*Message) MustConfirmationOpMessage

func (m *Message) MustConfirmationOpMessage() (msg ConfirmationOpMsg)

func (*Message) MustItemCreatedMessage

func (m *Message) MustItemCreatedMessage() (msg ItemCreatedMessage)

func (*Message) MustItemOnChainDataCreatedMessage

func (m *Message) MustItemOnChainDataCreatedMessage() (msg ItemOnChainDataCreatedMessage)

func (*Message) MustItemOnChainDataRemovedMessage

func (m *Message) MustItemOnChainDataRemovedMessage() (msg ItemOnChainDataRemovedMessage)

func (*Message) MustItemRemovedMessage

func (m *Message) MustItemRemovedMessage() (msg ItemRemovedMessage)

func (*Message) MustRejectionOpMessage

func (m *Message) MustRejectionOpMessage() (msg RejectionOpMsg)

func (*Message) MustSeedCreatedMessage

func (m *Message) MustSeedCreatedMessage() (msg SeedCreatedMessage)

func (*Message) MustSeedRemovedMessage

func (m *Message) MustSeedRemovedMessage() (msg SeedRemovedMessage)

func (*Message) MustTransferOpMessage

func (m *Message) MustTransferOpMessage() (msg TransferOpMsg)

func (*Message) MustVoteOpMessage

func (m *Message) MustVoteOpMessage() (msg VoteOpMsg)

func (Message) String

func (m Message) String() string

func (*Message) Type

func (m *Message) Type() MessageType

type MessageType

type MessageType string
const (
	MessageTypeCollectionCreated     MessageType = tokenmanager.EventTypeCollectionCreated
	MessageTypeCollectionRemoved     MessageType = tokenmanager.EventTypeCollectionRemoved
	MessageTypeCollectionDataCreated MessageType = tokenmanager.EventTypeCollectionDataCreated
	MessageTypeCollectionDataRemoved MessageType = tokenmanager.EventTypeCollectionDataRemoved
	MessageTypeCollectionDataUpdated MessageType = tokenmanager.EventTypeCollectionDataUpdated
)
const (
	MessageTypeItemCreated            MessageType = tokenmanager.EventTypeItemCreated
	MessageTypeItemRemoved            MessageType = tokenmanager.EventTypeItemRemoved
	MessageTypeItemOnChainDataCreated MessageType = tokenmanager.EventTypeOnChainItemCreated
	MessageTypeItemOnChainDataRemoved MessageType = tokenmanager.EventTypeOnChainItemRemoved
)
const (
	MessageTypeTransferOp     MessageType = rarimocore.EventTypeNewOperation
	MessageTypeConfirmationOp MessageType = rarimocore.EventTypeNewConfirmation
)
const (
	MessageTypeSeedCreated MessageType = tokenmanager.EventTypeSeedCreated
	MessageTypeSeedRemoved MessageType = tokenmanager.EventTypeSeedRemoved
)
const (
	MessageTypeVoteOp      MessageType = rarimocore.EventTypeVoted
	MessageTypeApprovalOp  MessageType = rarimocore.EventTypeOperationApproved
	MessageTypeRejectionOp MessageType = rarimocore.EventTypeOperationRejected
)
const MessageTypeBlockRange MessageType = "block_range"

type MultiPublisher

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

func (*MultiPublisher) PublishMsgs

func (m *MultiPublisher) PublishMsgs(ctx context.Context, msgs ...Message) error

type Publisher

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

func NewPublisher

func NewPublisher(log *logan.Entry, redisClient *redis.Client, tag, queueName string) (*Publisher, error)

func (*Publisher) PublishMsgs

func (p *Publisher) PublishMsgs(ctx context.Context, msgs ...Message) error

type RejectionOpMsg

type RejectionOpMsg struct {
	OperationID     string `json:"operation_id"`
	OperationType   string `json:"operation_type"`
	TransactionHash string `json:"transaction_hash"`
}

func (RejectionOpMsg) Message

func (m RejectionOpMsg) Message() Message

type SeedCreatedMessage

type SeedCreatedMessage struct {
	Seed      string `json:"seed"`
	ItemIndex string `json:"index"`
	TxHash    string `json:"tx_hash"`
}

func (SeedCreatedMessage) Message

func (m SeedCreatedMessage) Message() Message

type SeedRemovedMessage

type SeedRemovedMessage struct {
	Seed      string `json:"seed"`
	ItemIndex string `json:"index"`
	TxHash    string `json:"tx_hash"`
}

func (SeedRemovedMessage) Message

func (m SeedRemovedMessage) Message() Message

type TransferOpMsg

type TransferOpMsg struct {
	TransferID      string `json:"transfer_id"`
	TransactionHash string `json:"transaction_hash"`
}

func (TransferOpMsg) Message

func (m TransferOpMsg) Message() Message

type VoteOpMsg

type VoteOpMsg struct {
	OperationID     string `json:"operation_id"`
	OperationType   string `json:"operation_type"`
	VotingChoice    string `json:"voting_choice"`
	TransactionHash string `json:"transaction_hash"`
}

func (VoteOpMsg) Message

func (m VoteOpMsg) Message() Message

Jump to

Keyboard shortcuts

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