foundation

package module
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

README

foundation-go

Go Report Card

go 相关工具包

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheAccessor added in v0.2.10

type CacheAccessor interface {
	Set(key, value string, expiresIn int) error
	Get(key string) (string, error)
	Delete(key string) error
	IncrBy(key string, value int64) (result int64, err error)
	Exists(key string) (bool, error)
}

CacheAccessor 缓存读取器

type Event

type Event interface {
	Marshal() []byte
	Topic() string
}

type EventHandler

type EventHandler func(context.Context, ...[]byte) error

type EventInspector

type EventInspector interface {
	RequeueEvent(ctx context.Context, targetType string, durationSec int64) error
	EventAck(ctx context.Context, e Event) error
}

type EventManager

type EventManager interface {
	Publish(ctx context.Context, topic string, event Event, opts ...EventPublishOption) error
	Subscribe(ctx context.Context, group, topic string, handler EventHandler) error
	ProducerErrors() <-chan error
	ConsumerErrors() <-chan error
	Close() error
}

type EventOptions

type EventOptions interface {
	Partition() int32
	SetPartition(partition int32)
}

type EventPublishOption

type EventPublishOption func(options EventOptions)

type Message added in v0.2.12

type Message interface {
	Send(context.Context, *MessageTemplate) error
}

type MessageTemplate added in v0.2.12

type MessageTemplate struct {
	To            string                 `json:"to"`
	SignName      string                 `json:"sign_name"`
	TemplateCode  string                 `json:"template_name"`
	TemplateParam map[string]interface{} `json:"template_param"`
}

type Storage

type Storage interface {
	Name() string
	Save(ctx context.Context, fileID string, reader io.Reader) error
	Fetch(ctx context.Context, fileID string, writer io.Writer) error
	Del(ctx context.Context, fileID string) error
	URL(ctx context.Context, fileID string) (*url.URL, error)
}

Directories

Path Synopsis
helper
internal

Jump to

Keyboard shortcuts

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