Documentation ¶
Index ¶
- Constants
- Variables
- func FillMsgs(ctx sdk.Context, key string, msg interface{})
- func GetFileLeastHeightInDir(dir string) (string, int64, error)
- func GetFileName(dir string, fileIndex int) string
- func GetFilePathAndFileIndexFromDir(dir string, maxFileSize int) (filePath string, fileIndex int, err error)
- func GetFileSize(filePath string) int
- func Retry(attempts int, sleep time.Duration, fn func() error) error
- func SetMkFifoFunc(mkFifo MkFifoFunc)
- type FileDeleter
- type GetFilePathAndFileIndexFromDirCb
- type MkFifoFunc
- type MsgSender
- type MsgWriter
- func NewDirMsgWriter(dir string, cb GetFilePathAndFileIndexFromDirCb) (MsgWriter, error)
- func NewFileMsgWriter(filePath string) (MsgWriter, error)
- func NewKafkaMsgWriter(brokers string) (MsgWriter, error)
- func NewNopMsgWriter() MsgWriter
- func NewPipeMsgWriter(pipe string) (MsgWriter, error)
- func NewStdOutMsgWriter() MsgWriter
- type NewHeightInfo
- type RegulateWriteDir
- type Worker
Constants ¶
View Source
const ( FlagBrokers = "brokers" FlagTopics = "subscribe-modules" FlagFeatureToggle = "feature-toggle" KafkaPubTopic = "coinex-dex" )
View Source
const ( CfgPrefixFile = "file:" CfgPrefixKafka = "kafka:" CfgPrefixOS = "os:" CfgPrefixDir = "dir:" CfgNamedPipe = "pipe:" CfgPrefixPrune = "prune:" )
View Source
const FILEHEIGHT = 10000
View Source
const RetryNum = math.MaxInt64
Variables ¶
View Source
var (
EventTypeMsgQueue = "kafka"
)
View Source
var MaxFileSize = 1024 * 1024 * 100
Functions ¶
func GetFileLeastHeightInDir ¶ added in v0.2.17
func GetFileName ¶
func GetFileSize ¶
func SetMkFifoFunc ¶
func SetMkFifoFunc(mkFifo MkFifoFunc)
Types ¶
type FileDeleter ¶ added in v0.2.17
type FileDeleter struct {
// contains filtered or unexported fields
}
func NewFileDeleter ¶ added in v0.2.17
func NewFileDeleter(heightCh <-chan int64, dir string) *FileDeleter
func (*FileDeleter) Run ¶ added in v0.2.17
func (p *FileDeleter) Run()
type GetFilePathAndFileIndexFromDirCb ¶ added in v0.2.17
type MkFifoFunc ¶
type MsgSender ¶
type MsgSender interface { SendMsg(key []byte, v []byte) IsSubscribed(topic string) bool IsOpenToggle() bool GetMode() []string Close() }
func NewProducer ¶
type MsgWriter ¶
func NewDirMsgWriter ¶
func NewDirMsgWriter(dir string, cb GetFilePathAndFileIndexFromDirCb) (MsgWriter, error)
func NewFileMsgWriter ¶
func NewKafkaMsgWriter ¶
func NewNopMsgWriter ¶
func NewNopMsgWriter() MsgWriter
func NewPipeMsgWriter ¶
func NewStdOutMsgWriter ¶
func NewStdOutMsgWriter() MsgWriter
type NewHeightInfo ¶ added in v0.2.17
type RegulateWriteDir ¶ added in v0.2.17
type RegulateWriteDir struct { MsgWriter // contains filtered or unexported fields }
func NewRegulateWriteDir ¶ added in v0.2.17
func NewRegulateWriteDir(dir string) (*RegulateWriteDir, error)
Click to show internal directories.
Click to hide internal directories.