adapter

package
v0.0.0-...-9835270 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: AGPL-3.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG_LEVEL_DEBUG = "debug"
	DEBUG_LEVEL_PROD  = "prod"
)

Variables

This section is empty.

Functions

func CheckSameDomain

func CheckSameDomain(domains []string) bool

func Contains

func Contains(obj interface{}, target interface{}) bool

func GetDebugLevel

func GetDebugLevel() string

func GetDomainCfg

func GetDomainCfg() []string

func GetKafkaEnableIdempotence

func GetKafkaEnableIdempotence() bool

func GetKafkaForceAsyncSend

func GetKafkaForceAsyncSend() bool

func GetKafkaNumPartitions

func GetKafkaNumPartitions() int

func GetKafkaNumProducers

func GetKafkaNumProducers() int

func GetKafkaReplicaFactor

func GetKafkaReplicaFactor() int

func GetLatestToken

func GetLatestToken() int

func GetTokenExpire

func GetTokenExpire() int64

func GetUtlExpire

func GetUtlExpire() int64

func Random

func Random(min, max int) int

func SetCacheCfg

func SetCacheCfg(tokenExpire, utlExpire int64, latestToken int)

func SetDebugLevel

func SetDebugLevel(debugLevel string)

func SetDistLockItemCfg

func SetDistLockItemCfg(item string, timeout, wait int, force bool)

func SetDomainCfg

func SetDomainCfg(domains []string)

func SetKafkaEnableIdempotence

func SetKafkaEnableIdempotence(enableIdempotence bool)

func SetKafkaForceAsyncSend

func SetKafkaForceAsyncSend(forceAsyncSend bool)

func SetKafkaNumPartitions

func SetKafkaNumPartitions(numPartitions int)

func SetKafkaNumProducers

func SetKafkaNumProducers(numProducers int)

func SetKafkaReplicaFactor

func SetKafkaReplicaFactor(replicaFactor int)

Types

type CacheCfg

type CacheCfg struct {
	TokenExpire int64
	UtlExpire   int64
	LatestToken int
}

type CommonCfg

type CommonCfg struct {
	Kafka    KafkaCommonCfg
	Domain   DomainCfg
	DistLock DistLockCfg
	Debug    DebugCfg
	Cache    CacheCfg
}
var AdapterCfg CommonCfg

type DebugCfg

type DebugCfg struct {
	DebugLevel string
}

type DistLockCfg

type DistLockCfg struct {
	LockInstance     LockCfg
	LockRoomState    LockCfg
	LockRoomStateExt LockCfg
}

func GetDistLockCfg

func GetDistLockCfg() DistLockCfg

type DomainCfg

type DomainCfg struct {
	Domains []string
}

type KafkaCommonCfg

type KafkaCommonCfg struct {
	EnableIdempotence bool
	//only avoid kafka sync send has problem can force to async send
	ForceAsyncSend bool
	ReplicaFactor  int
	NumPartitions  int
	NumProducers   int
}

type LockCfg

type LockCfg struct {
	Timeout int
	Wait    int
	Force   bool
}

Jump to

Keyboard shortcuts

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