types

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	Endpoint   *EndPoint   `toml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"`
	Credential *Credential `toml:"credential,omitempty" mapstructure:"queue_credential,omitempty"`
	Profile    *Profile    `toml:"profile,omitempty" mapstructure:"queue_profile,omitempty"`
}

type Application

type Application interface {
	PushResultMessage(result []byte)
	PutResultFile(name string, root string, data []byte)
}

type ChangeVisibilityMessage

type ChangeVisibilityMessage interface {
	GetChangeVisibilityID() string
}

type Config

type Config struct {
	Queue   QueueConfig   `mapstructure:"queue"`
	Storage StorageConfig `mapstructure:"storage"`
}

type Container

type Container interface {
	Add(handler interface{})
	Get() []interface{}
}

type Credential

type Credential struct {
	AccessKey       string `mapstructure:"access_key,omitempty"`
	AccessKeySecret string `mapstructure:"access_key_secret,omitempty"`
}

type DeletableMessage

type DeletableMessage interface {
	GetDeleteID() string
	IsDeleted() bool
	SetDeleted(deleted bool)
}

type EndPoint

type EndPoint struct {
	Region string `toml:"region" mapstructure:"region"`
	URL    string `toml:"url" mapstructure:"url"`
}

type Handler

type Handler interface {
	Exec(msg Message) error
}

type HandlerContainer

type HandlerContainer interface {
	Add(handler Handler)
	Get() []Handler
}

type LogLevel added in v1.2.1

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
)

func (LogLevel) String added in v1.2.1

func (l LogLevel) String() string

type Logger

type Logger interface {
	Info(format string, binder ...interface{})
	Debug(format string, binder ...interface{})
	Warn(format string, binder ...interface{})
	Error(format string, binder ...interface{})
	Flush()
}

type Message

type Message interface {
	GetID() string
	GetDeduplicationID() string
	DeletableMessage
	ChangeVisibilityMessage
	GetBody() []byte
}

type Profile

type Profile struct {
	Name          string `mapstructure:"name,omitempty"`
	AssumeRoleArn string `mapstructure:"assume_role_arn,omitempty"`
}

type QueueConfig

type QueueConfig struct {
	Endpoint   *EndPoint   `mapstructure:"endpoint,omitempty"`
	Credential *Credential `mapstructure:"credential,omitempty"`
	Profile    *Profile    `mapstructure:"profile,omitempty"`
	URL        string      `mapstructure:"url"`
}

func (QueueConfig) GetAWSConfig

func (qc QueueConfig) GetAWSConfig() AWSConfig

type QueueDriver

type QueueDriver interface {
	GetConfig() *QueueConfig
	GetMessage(num int) ([]Message, error)
	PutMessage(raw []byte, delay int32) error
	DeleteMessage(msg DeletableMessage) error
	GetMessageLength() ([]string, error)
	ChangeMessageVisibility(msg ChangeVisibilityMessage, second int32) error
}

type QueueSessionUpdater

type QueueSessionUpdater interface {
	UpdateQueue(cfg *QueueConfig) (QueueDriver, error)
}

type SessionManager

type SessionManager interface {
	UpdateSession()
	CreateStorageWithConfig(customConfig StorageConfig) (StorageDriver, error)
	CreateQueueWithConfig(customConfig QueueConfig) (QueueDriver, error)
	GetQueue() (QueueDriver, error)
	GetStorage() (StorageDriver, error)
	QueueSessionUpdater
	StorageSessionUpdater
}

type SessionManagerFactory

type SessionManagerFactory interface {
	Create() (SessionManager, error)
	CreateWithConfig(queue QueueConfig, session StorageConfig) (SessionManager, error)
}

type StorageConfig

type StorageConfig struct {
	Endpoint   *EndPoint   `mapstructure:"endpoint,omitempty"`
	Credential *Credential `mapstructure:"credential,omitempty"`
	Profile    *Profile    `mapstructure:"profile,omitempty"`
}

func (StorageConfig) GetAWSConfig

func (sc StorageConfig) GetAWSConfig() AWSConfig

type StorageDriver

type StorageDriver interface {
	GetConfig() *StorageConfig
	Get(root string, path string) ([]byte, error)
	GetByStream(root string, path string) (io.ReadCloser, error)
	Download(bucket string, key string, dist string) error
	Put(root string, path string, raw []byte) error
	List(root string, prefix string) (list []string, err error, next func() ([]string, error))
}

type StorageSessionUpdater

type StorageSessionUpdater interface {
	UpdateStorage(cfg *StorageConfig) (StorageDriver, error)
}

type Subscriber

type Subscriber interface {
	Listen()
}

type Updatable

type Updatable interface {
	Update()
}

type WorkerCommand

type WorkerCommand struct {
	Command *cobra.Command
	Handler func(Message) []byte
}

func (*WorkerCommand) SetHandler

func (c *WorkerCommand) SetHandler(handler func(Message) []byte)

Jump to

Keyboard shortcuts

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