config

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockTask

type BlockTask struct {
	FromCluster []*FromCluster `json:"FromCluster"`
	Kafka       *Kafka         `json:"Kafka"`
}

func (*BlockTask) CopyBlockTask

func (b *BlockTask) CopyBlockTask() BlockTask

type Chain

type Chain struct {
	//Etcd           *Etcd        `json:"Etcd"`
	BlockChainName string `json:"BlockChainName"`
	BlockChainCode int    `json:"BlockChainCode"`
	//NodeWeight     int          `json:"NodeWeight"`
	PullReceipt uint8        `json:"PullReceipt"` //0:没有收据任务,1:批量收据任务,2:单笔收据任务
	PullTx      uint8        `json:"PullTx"`      //0:没有交易任务,1:批量交易任务,2:单笔交易任务
	Kafka       *Kafka       `json:"Kafka"`       //结果数据Kafka
	TaskKafka   *Kafka       `json:"TaskKafka"`   //任务kafka
	BlockTask   *BlockTask   `json:"BlockTask"`
	TxTask      *TxTask      `json:"TxTask"`
	ReceiptTask *ReceiptTask `json:"ReceiptTask"`
	Redis       *Redis       `json:"Redis"`
}

func (*Chain) CopyChain

func (c *Chain) CopyChain() Chain

type Config

type Config struct {
	Chains    []*Chain   `json:"Chains"`
	LogConfig *LogConfig `json:"Log"`
	Retry     *Retry     `json:"Retry"`
	KeyPath   string     `json:"KeyPath"`
}

func LoadConfig

func LoadConfig(path string) Config

type FromCluster

type FromCluster struct {
	Host       string `json:"Host"`
	Port       int    `json:"Port"`
	Key        string `json:"Key"`
	Weight     int64  `json:"Weight"`
	ErrorCount int64  `json:"ErrorCount"`
}

func (*FromCluster) CopyFromCluster

func (f *FromCluster) CopyFromCluster() FromCluster

type Kafka

type Kafka struct {
	Host        string  `json:"Host"`
	Port        int     `json:"Port"`
	Topic       string  `json:"Topic"`
	Partition   int     `json:"Partition"`
	Partitions  []int64 `json:"WritePartitions"`
	Group       string  `json:"Group"`
	StartOffset int64   `json:"StartOffset"`
}

func (*Kafka) CopyKafka

func (k *Kafka) CopyKafka() Kafka

type LogConfig

type LogConfig struct {
	Path     string `json:"Path"`
	Delay    int64  `json:"Delay"`
	LogLevel int    `json:"LogLevel"`
}

type ReceiptTask

type ReceiptTask struct {
	FromCluster []*FromCluster `json:"FromCluster"`
	Kafka       *Kafka         `json:"Kafka"`
}

func (*ReceiptTask) CopyReceiptTask

func (b *ReceiptTask) CopyReceiptTask() ReceiptTask

type Redis

type Redis struct {
	Addr string `json:"Addr"`
	Port int64  `json:"Port"`
	DB   int    `json:"DB"`
}

type Retry added in v0.5.3

type Retry struct {
	ErrTx    int64 `json:"ErrTx" gorm:"column:ErrTx"`
	NodeTask int64 `json:"NodeTask" gorm:"column:NodeTask"`
	Contract int64 `json:"Contract" gorm:"column:Contract"`
}

type TaskDb

type TaskDb struct {
	Addr     string `json:"Addr"`
	Port     int    `json:"Port"`
	User     string `json:"User"`
	Password string `json:"Password"`
	DbName   string `json:"DbName"`
	Table    string `json:"Table"`
}

type TxTask

type TxTask struct {
	FromCluster []*FromCluster `json:"FromCluster"`
	Kafka       *Kafka         `json:"Kafka"`
}

func (*TxTask) CopyTxTask

func (b *TxTask) CopyTxTask() TxTask

Jump to

Keyboard shortcuts

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