xlm

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricReceiveMessages             = "receive_messages"
	MetricParseDataError              = "parse_data_error"
	MetricVaildationSuccess           = "validation_success"
	MetricVaildationError             = "validation_error"
	MetricDatabaseRollback            = "database_rollback"
	MetricDatabaseCommit              = "database_commit"
	MetricCronWorkerJob               = "cron_worker_job"
	MetricCronWorkerJobUpdateMetaData = "cron_worker_job_update_meta_data"
	MetricReceiveLedger               = "receive_ledger"
	MetricSendLedger                  = "send_ledger"
	MetricSaveLedger                  = "save_ledger"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountMerge

type AccountMerge struct {
	Account string `json:"account"`
	Into    string `json:"into"`
}

AccountMerge is the json resource representing a single operation whose type is AccountMerge.

type AllowTrust

type AllowTrust struct {
	Asset
	Trustee   string `json:"trustee"`
	Trustor   string `json:"trustor"`
	Authorize bool   `json:"authorize"`
}

AllowTrust is the json resource representing a single operation whose type is AllowTrust.

type Asset

type Asset struct {
	Type   string `json:"asset_type"`
	Code   string `json:"asset_code,omitempty"`
	Issuer string `json:"asset_issuer,omitempty"`
}

type BumpSequence

type BumpSequence struct {
	BumpTo string `json:"bump_to"`
}

type ChangeTrust

type ChangeTrust struct {
	Asset
	Limit   string `json:"limit"`
	Trustee string `json:"trustee"`
	Trustor string `json:"trustor"`
}

ChangeTrust is the json resource representing a single operation whose type is ChangeTrust.

type CreateAccount

type CreateAccount struct {
	StartingBalance string `json:"starting_balance"`
	Funder          string `json:"funder"`
	Account         string `json:"account"`
}

CreateAccount is the json resource representing a single operation whose type is CreateAccount.

type CreatePassiveOffer

type CreatePassiveOffer struct {
	Amount             string `json:"amount"`
	Price              string `json:"price"`
	PriceR             Price  `json:"price_r"`
	BuyingAssetType    string `json:"buying_asset_type"`
	BuyingAssetCode    string `json:"buying_asset_code,omitempty"`
	BuyingAssetIssuer  string `json:"buying_asset_issuer,omitempty"`
	SellingAssetType   string `json:"selling_asset_type"`
	SellingAssetCode   string `json:"selling_asset_code,omitempty"`
	SellingAssetIssuer string `json:"selling_asset_issuer,omitempty"`
}

CreatePassiveOffer is the json resource representing a single operation whose type is CreatePassiveOffer.

type CronWorker

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

func NewCronWorker

func NewCronWorker(splitter *XLMSplitter) *CronWorker

func (*CronWorker) Prepare

func (w *CronWorker) Prepare() error

func (*CronWorker) Start

func (w *CronWorker) Start() error

func (*CronWorker) Stop

func (w *CronWorker) Stop()

type Inflation

type Inflation struct {
}

Inflation is the json resource representing a single operation whose type is Inflation.

type ManageData

type ManageData struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

ManageData represents a ManageData operation as it is serialized into json for the horizon API.

type ManageOffer

type ManageOffer struct {
	CreatePassiveOffer
	OfferID int64 `json:"offer_id"`
}

ManageOffer is the json resource representing a single operation whose type is ManageOffer.

type PathPayment

type PathPayment struct {
	Payment
	Path              []Asset `json:"path"`
	SourceAmount      string  `json:"source_amount"`
	SourceMax         string  `json:"source_max"`
	SourceAssetType   string  `json:"source_asset_type"`
	SourceAssetCode   string  `json:"source_asset_code,omitempty"`
	SourceAssetIssuer string  `json:"source_asset_issuer,omitempty"`
}

PathPayment is the json resource representing a single operation whose type is PathPayment.

type Payment

type Payment struct {
	Asset
	From   string `json:"from"`
	To     string `json:"to"`
	Amount string `json:"amount"`
}

Payment is the json resource representing a single operation whose type is Payment.

type Price

type Price struct {
	N int32 `json:"n"`
	D int32 `json:"d"`
}

type SetOptions

type SetOptions struct {
	HomeDomain    string `json:"home_domain,omitempty"`
	InflationDest string `json:"inflation_dest,omitempty"`

	MasterKeyWeight *int   `json:"master_key_weight,omitempty"`
	SignerKey       string `json:"signer_key,omitempty"`
	SignerWeight    *int   `json:"signer_weight,omitempty"`

	SetFlags    []int    `json:"set_flags,omitempty"`
	SetFlagsS   []string `json:"set_flags_s,omitempty"`
	ClearFlags  []int    `json:"clear_flags,omitempty"`
	ClearFlagsS []string `json:"clear_flags_s,omitempty"`

	LowThreshold  *int `json:"low_threshold,omitempty"`
	MedThreshold  *int `json:"med_threshold,omitempty"`
	HighThreshold *int `json:"high_threshold,omitempty"`
}

SetOptions is the json resource representing a single operation whose type is SetOptions.

type SplitterConfig

type SplitterConfig struct {
	Engine                     *xorm.Engine
	Consumer                   *kafka.ConsumerGroup
	Topic                      string
	DatabaseEnable             bool
	MaxBatchLedger             int
	Endpoint                   string
	JSONSchemaFile             string
	JSONSchemaValidationEnable bool
	ConcurrentHeight           int64
	ConcurrentHTTP             int64
	DatabaseWorkerBuffer       int
	DatabaseWorkerNumber       int
}

type WorkerJob

type WorkerJob interface {
	Run()
	Name() string
	// contains filtered or unexported methods
}

type XLMLedgerData

type XLMLedgerData struct {
	Ledger       *model.Ledger
	Transactions []*model.Transaction
	Operations   []*model.Operation
}

func ParseLedger

func ParseLedger(data string) ([]*XLMLedgerData, error)

type XLMSplitter

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

func NewSplitter

func NewSplitter(cfg *SplitterConfig) (*XLMSplitter, error)

func (*XLMSplitter) CheckLedger

func (s *XLMSplitter) CheckLedger(curLedger *XLMLedgerData) (bool, int64)

func (*XLMSplitter) SaveLedger

func (s *XLMSplitter) SaveLedger(data []*XLMLedgerData) error

func (*XLMSplitter) Start

func (s *XLMSplitter) Start()

func (*XLMSplitter) Stop

func (s *XLMSplitter) Stop()

Jump to

Keyboard shortcuts

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