broker

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgErrJSONMarshalFail   = "json marshal fail: %w"
	MsgErrCreateProducer    = "cant create producer connection to broker: %w "
	MsgErrCreateAdminClient = "cant create admin client connection to broker: %w"
	MsgErrCreateTopics      = "cant create topics in broker: %w"
	MsgErrCreatePartitions  = "cant create partitions in broker: %w"
)

Variables

This section is empty.

Functions

func WithAccountCache

func WithAccountCache(accCache cacheI[string, int64]) func(b *Broker)

func WithValidatorCache

func WithValidatorCache(valCache cacheI[string, int64]) func(b *Broker)

func WithValidatorCommissionCache

func WithValidatorCommissionCache(valCommissionCache cacheI[string, int64]) func(b *Broker)

func WithValidatorDescriptionCache

func WithValidatorDescriptionCache(valDescriptionCache cacheI[string, int64]) func(b *Broker)

func WithValidatorInfoCache

func WithValidatorInfoCache(valInfoCache cacheI[string, int64]) func(b *Broker)

func WithValidatorStatusCache

func WithValidatorStatusCache(valStatusCache cacheI[string, int64]) func(b *Broker)

Types

type Broker

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

func New

func New(cfg Config, modules []string, l zerolog.Logger, opts ...opts) *Broker

func (*Broker) PublishAccount

func (b *Broker) PublishAccount(ctx context.Context, account model.Account) error

func (*Broker) PublishAccountBalance

func (b *Broker) PublishAccountBalance(ctx context.Context, ab model.AccountBalance) error

func (*Broker) PublishAcknowledgementMessage added in v0.2.1

func (b *Broker) PublishAcknowledgementMessage(ctx context.Context, msg model.AcknowledgementMessage) error

func (*Broker) PublishAnnualProvision

func (b *Broker) PublishAnnualProvision(ctx context.Context, ap model.AnnualProvision) error

func (*Broker) PublishAuthzGrant

func (b *Broker) PublishAuthzGrant(ctx context.Context, grant model.AuthzGrant) error

func (*Broker) PublishBlock

func (b *Broker) PublishBlock(ctx context.Context, block model.Block) error

func (*Broker) PublishCancelUnbondingDelegationMessage

func (b *Broker) PublishCancelUnbondingDelegationMessage(
	_ context.Context,
	description model.CancelUnbondingDelegationMessage,
) error

func (*Broker) PublishCommunityPool

func (b *Broker) PublishCommunityPool(ctx context.Context, cp model.CommunityPool) error

func (*Broker) PublishCreateValidatorMessage

func (b *Broker) PublishCreateValidatorMessage(_ context.Context, cvm model.CreateValidatorMessage) error

func (*Broker) PublishDelegation

func (b *Broker) PublishDelegation(ctx context.Context, d model.Delegation) error

func (*Broker) PublishDelegationMessage

func (b *Broker) PublishDelegationMessage(ctx context.Context, dm model.DelegationMessage) error

func (*Broker) PublishDelegationReward

func (b *Broker) PublishDelegationReward(ctx context.Context, dr model.DelegationReward) error

func (*Broker) PublishDelegationRewardMessage

func (b *Broker) PublishDelegationRewardMessage(ctx context.Context, drm model.DelegationRewardMessage) error

func (*Broker) PublishDenomTrace added in v0.2.2

func (b *Broker) PublishDenomTrace(ctx context.Context, dt model.DenomTrace) error

func (*Broker) PublishDistributionCommission

func (b *Broker) PublishDistributionCommission(_ context.Context, commission model.DistributionCommission) error

func (*Broker) PublishDistributionParams

func (b *Broker) PublishDistributionParams(ctx context.Context, dp model.DistributionParams) error

func (*Broker) PublishDistributionReward

func (b *Broker) PublishDistributionReward(_ context.Context, reward model.DistributionReward) error

func (*Broker) PublishEditValidatorMessage

func (b *Broker) PublishEditValidatorMessage(_ context.Context, msg model.EditValidatorMessage) error

func (*Broker) PublishExecMessage

func (b *Broker) PublishExecMessage(ctx context.Context, em model.ExecMessage) error

func (*Broker) PublishFeeAllowance

func (b *Broker) PublishFeeAllowance(ctx context.Context, feeAllowance model.FeeAllowance) error

func (*Broker) PublishGovParams

func (b *Broker) PublishGovParams(ctx context.Context, params model.GovParams) error

func (*Broker) PublishGrantAllowanceMessage

func (b *Broker) PublishGrantAllowanceMessage(ctx context.Context, gam model.GrantAllowanceMessage) error

func (*Broker) PublishGrantMessage

func (b *Broker) PublishGrantMessage(ctx context.Context, gm model.GrantMessage) error

func (*Broker) PublishHandleValidatorSignature added in v0.0.4

func (b *Broker) PublishHandleValidatorSignature(ctx context.Context, hvs model.HandleValidatorSignature) error

func (*Broker) PublishLiquidityPool added in v0.2.4

func (b *Broker) PublishLiquidityPool(_ context.Context, v model.LiquidityPool) error

func (*Broker) PublishMessage

func (b *Broker) PublishMessage(ctx context.Context, message model.Message) error

func (*Broker) PublishMintParams

func (b *Broker) PublishMintParams(ctx context.Context, mp model.MintParams) error

func (*Broker) PublishMultiSendMessage

func (b *Broker) PublishMultiSendMessage(ctx context.Context, msm model.MultiSendMessage) error

func (*Broker) PublishProposal

func (b *Broker) PublishProposal(ctx context.Context, proposal model.Proposal) error

func (*Broker) PublishProposalDeposit

func (b *Broker) PublishProposalDeposit(ctx context.Context, pvm model.ProposalDeposit) error

func (*Broker) PublishProposalDepositMessage

func (b *Broker) PublishProposalDepositMessage(ctx context.Context, pvm model.ProposalDepositMessage) error

func (*Broker) PublishProposalTallyResult

func (b *Broker) PublishProposalTallyResult(ctx context.Context, ptr model.ProposalTallyResult) error

func (*Broker) PublishProposalVoteMessage

func (b *Broker) PublishProposalVoteMessage(ctx context.Context, pvm model.ProposalVoteMessage) error

func (*Broker) PublishProposerReward

func (b *Broker) PublishProposerReward(ctx context.Context, r model.ProposerReward) error

func (*Broker) PublishReceivePacketMessage added in v0.2.1

func (b *Broker) PublishReceivePacketMessage(ctx context.Context, r model.RecvPacketMessage) error

func (*Broker) PublishRedelegation

func (b *Broker) PublishRedelegation(ctx context.Context, r model.Redelegation) error

func (*Broker) PublishRedelegationMessage

func (b *Broker) PublishRedelegationMessage(ctx context.Context, rm model.RedelegationMessage) error

func (*Broker) PublishRevokeAllowanceMessage

func (b *Broker) PublishRevokeAllowanceMessage(ctx context.Context, ram model.RevokeAllowanceMessage) error

func (*Broker) PublishRevokeMessage

func (b *Broker) PublishRevokeMessage(ctx context.Context, rm model.RevokeMessage) error

func (*Broker) PublishSendMessage

func (b *Broker) PublishSendMessage(ctx context.Context, sm model.SendMessage) error

func (*Broker) PublishSetWithdrawAddressMessage

func (b *Broker) PublishSetWithdrawAddressMessage(_ context.Context, swm model.SetWithdrawAddressMessage) error

func (*Broker) PublishStakingParams

func (b *Broker) PublishStakingParams(ctx context.Context, sp model.StakingParams) error

func (*Broker) PublishStakingPool

func (b *Broker) PublishStakingPool(ctx context.Context, sp model.StakingPool) error

func (*Broker) PublishSubmitProposalMessage

func (b *Broker) PublishSubmitProposalMessage(_ context.Context, spm model.SubmitProposalMessage) error

func (*Broker) PublishSupply

func (b *Broker) PublishSupply(ctx context.Context, supply model.Supply) error

func (*Broker) PublishSwap added in v0.2.4

func (b *Broker) PublishSwap(ctx context.Context, swap model.Swap) error

func (*Broker) PublishTransaction

func (b *Broker) PublishTransaction(ctx context.Context, tx model.Transaction) error

func (*Broker) PublishTransferMessage added in v0.2.1

func (b *Broker) PublishTransferMessage(ctx context.Context, tm model.TransferMessage) error

func (*Broker) PublishUnbondingDelegation

func (b *Broker) PublishUnbondingDelegation(ctx context.Context, ud model.UnbondingDelegation) error

func (*Broker) PublishUnbondingDelegationMessage

func (b *Broker) PublishUnbondingDelegationMessage(ctx context.Context, udm model.UnbondingDelegationMessage) error

func (*Broker) PublishUnjailMessage added in v0.0.2

func (b *Broker) PublishUnjailMessage(_ context.Context, msg model.UnjailMessage) error

func (*Broker) PublishValidator

func (b *Broker) PublishValidator(ctx context.Context, val model.Validator) error

func (*Broker) PublishValidatorCommission

func (b *Broker) PublishValidatorCommission(ctx context.Context, commission model.ValidatorCommission) error

func (*Broker) PublishValidatorDescription

func (b *Broker) PublishValidatorDescription(ctx context.Context, description model.ValidatorDescription) error

func (*Broker) PublishValidatorInfo

func (b *Broker) PublishValidatorInfo(ctx context.Context, info model.ValidatorInfo) error

func (*Broker) PublishValidatorStatus

func (b *Broker) PublishValidatorStatus(ctx context.Context, status model.ValidatorStatus) error

func (*Broker) PublishVoteWeightedMessage

func (b *Broker) PublishVoteWeightedMessage(_ context.Context, vwm model.VoteWeightedMessage) error

func (*Broker) PublishWithdrawValidatorCommissionMessage

func (b *Broker) PublishWithdrawValidatorCommissionMessage(
	_ context.Context,
	wvcm model.WithdrawValidatorCommissionMessage,
) error

func (*Broker) Start

func (b *Broker) Start(ctx context.Context) error

func (*Broker) Stop

func (b *Broker) Stop(ctx context.Context) error

type Config

type Config struct {
	ServerURL       string `env:"BROKER_SERVER"`
	PartitionsCount int    `env:"PARTITIONS_COUNT" envDefault:"1"`
	Enabled         bool   `env:"BROKER_ENABLED"`
}

type Topic

type Topic *string
var (
	Account                            Topic = newTopic("account")
	AuthzGrant                         Topic = newTopic("authz_grant")
	AcknowledgementMessage             Topic = newTopic("acknowledgement_message")
	AccountBalance                     Topic = newTopic("account_balance")
	AnnualProvision                    Topic = newTopic("annual_provision")
	Block                              Topic = newTopic("block")
	CancelUnbondingDelegationMessage   Topic = newTopic("cancel_unbonding_delegation_message")
	CommunityPool                      Topic = newTopic("community_pool")
	CreateValidatorMessage             Topic = newTopic("create_validator_message")
	DistributionCommission             Topic = newTopic("distribution_commission")
	DistributionReward                 Topic = newTopic("distribution_reward")
	DistributionParams                 Topic = newTopic("distribution_params")
	DelegationReward                   Topic = newTopic("delegation_reward")
	DelegationRewardMessage            Topic = newTopic("delegation_reward_message")
	Delegation                         Topic = newTopic("delegation")
	DelegationMessage                  Topic = newTopic("delegation_message")
	DenomTrace                         Topic = newTopic("denom_trace")
	EditValidatorMessage               Topic = newTopic("edit_validator_message")
	ExecMessage                        Topic = newTopic("exec_message")
	FeeAllowance                       Topic = newTopic("fee_allowance")
	GovParams                          Topic = newTopic("gov_params")
	GrantMessage                       Topic = newTopic("grant_message")
	GrantAllowanceMessage              Topic = newTopic("grant_allowance_message")
	HandleValidatorSignature           Topic = newTopic("handle_validator_signature")
	LiquidityPool                      Topic = newTopic("liquidity_pool")
	Message                            Topic = newTopic("message")
	MintParams                         Topic = newTopic("mint_params")
	MultiSendMessage                   Topic = newTopic("multisend_message")
	Proposal                           Topic = newTopic("proposal")
	ProposalVoteMessage                Topic = newTopic("proposal_vote_message")
	ProposalTallyResult                Topic = newTopic("proposal_tally_result")
	ProposalDeposit                    Topic = newTopic("proposal_deposit")
	ProposalDepositMessage             Topic = newTopic("proposal_deposit_message")
	ProposerReward                     Topic = newTopic("proposer_reward")
	RevokeAllowanceMessage             Topic = newTopic("revoke_allowance_message")
	Redelegation                       Topic = newTopic("redelegation")
	RedelegationMessage                Topic = newTopic("redelegation_message")
	RevokeMessage                      Topic = newTopic("revoke_message")
	ReceivePacketMessage               Topic = newTopic("receive_packet_message")
	SendMessage                        Topic = newTopic("send_message")
	SetWithdrawAddressMessage          Topic = newTopic("set_withdraw_address_message")
	StakingParams                      Topic = newTopic("staking_params")
	StakingPool                        Topic = newTopic("staking_pool")
	SubmitProposalMessage              Topic = newTopic("submit_proposal_message")
	Supply                             Topic = newTopic("supply")
	Swap                               Topic = newTopic("swap")
	Transaction                        Topic = newTopic("transaction")
	TransferMessage                    Topic = newTopic("transfer_message")
	UnbondingDelegation                Topic = newTopic("unbonding_delegation")
	UnbondingDelegationMessage         Topic = newTopic("unbonding_delegation_message")
	UnjailMessage                      Topic = newTopic("unjail_message")
	Validator                          Topic = newTopic("validator")
	ValidatorInfo                      Topic = newTopic("validator_info")
	ValidatorStatus                    Topic = newTopic("validator_status")
	ValidatorDescription               Topic = newTopic("validator_description")
	ValidatorCommission                Topic = newTopic("validator_commission")
	VoteWeightedMessage                Topic = newTopic("vote_weighted_message")
	WithdrawValidatorCommissionMessage Topic = newTopic("withdraw_validator_commission_message")
)

type Topics

type Topics []Topic

func (Topics) ToStringSlice

func (ts Topics) ToStringSlice() []string

Jump to

Keyboard shortcuts

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