mq

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidStoreType = errors.New("invalid StoreType type")

Functions

func WithMq

func WithMq(ctx context.Context, c *Config) context.Context

func WithMqContext

func WithMqContext(c *Config) contextx.WithContext

Types

type Config

type Config struct {
	// Channel worker channel name
	Channel string
	// Store type in memory
	Store StoreType
	// Limit message queue max length
	Limit int
	// WorkerCount task worker count (concurrency)
	WorkerCount      int
	PushQueueTimeout types.Duration

	*mq.TaskBoard
	*mq.TaskWorker
}

func MqFromContext

func MqFromContext(ctx context.Context) (*Config, bool)

func MustMqFromContext

func MustMqFromContext(ctx context.Context) *Config

func (*Config) Init

func (c *Config) Init() error

func (*Config) Name

func (c *Config) Name() string

func (*Config) SetDefault

func (c *Config) SetDefault()

type StoreType

type StoreType uint8
const (
	STORE_TYPE_UNKNOWN StoreType = iota
	STORE_TYPE__MEM
	STORE_TYPE__REDIS
)

func ParseStoreTypeFromLabel

func ParseStoreTypeFromLabel(s string) (StoreType, error)

func ParseStoreTypeFromString

func ParseStoreTypeFromString(s string) (StoreType, error)

func (StoreType) ConstValues

func (v StoreType) ConstValues() []enum.IntStringerEnum

func (StoreType) Int

func (v StoreType) Int() int

func (StoreType) Label

func (v StoreType) Label() string

func (StoreType) MarshalText

func (v StoreType) MarshalText() ([]byte, error)

func (*StoreType) Scan

func (v *StoreType) Scan(src interface{}) error

func (StoreType) String

func (v StoreType) String() string

func (StoreType) TypeName

func (v StoreType) TypeName() string

func (*StoreType) UnmarshalText

func (v *StoreType) UnmarshalText(data []byte) error

func (StoreType) Value

func (v StoreType) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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