infra

package
v0.0.0-...-a4eaa21 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonError          = 00010001
	DeleteEffectRowsZero = 00010002
	JsonIterator         = 00010003
	DBError              = 00010004
	ParamsValidateError  = 00010005
	BusinessParamsError  = 00010006
	WindowNotExists      = 10001001
	TriggerNotExists     = 10001002
	OperatorNotExists    = 10001003
	EvictorNotExists     = 10001004
	CalTaskNotFound      = 10001005
)

Variables

View Source
var DataFlowDB = "dataflow_db"
View Source
var EmptyDetail = make(map[string]any)
View Source
var MongoURI string

Functions

func ErrText

func ErrText(code int64) string

func MakeHttpRequest

func MakeHttpRequest(method string, url string, beforeFn func(reader *bytes.Buffer), AfterFn func(response *http.Response))

func PanicErr

func PanicErr(originErr error, code ...int64)

func ToEvictor

func ToEvictor(evictor *model.Evictor) core.Evictor

func ToEvictorModel

func ToEvictorModel(evictor core.Evictor) *model.Evictor

func ToOperator

func ToOperator(operator *model.Operator) core.Operator

func ToOperatorModel

func ToOperatorModel(operator core.Operator) *model.Operator

func ToTrigger

func ToTrigger(trigger *model.Trigger) core.Trigger

func ToTriggerModel

func ToTriggerModel(trigger core.Trigger) *model.Trigger

func ToWindow

func ToWindow(window *model.Window) core.Windows

func ToWindowModel

func ToWindowModel(windows core.Windows) *model.Window

func WrapDB

func WrapDB(ctx context.Context, fn func(database *mongo.Database))

Types

type CalTaskRepo

type CalTaskRepo interface {
	Create(resource *model.CalTask) string
	GetByProcessorId(id string) []*model.CalTask
	DeleteByProcessorId(id string)
	GetAll() []*model.CalTask
}

type Error

type Error struct {
	Code      int64
	Message   string
	Details   map[string]any
	OriginErr error
}

func NewError

func NewError(code int64, message string, originErr error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) IsSuccess

func (e *Error) IsSuccess() bool

func (*Error) SetDetails

func (e *Error) SetDetails(details map[string]any)

type EvictorRepo

type EvictorRepo interface {
	Create(evictor *model.Evictor) string
	Delete(id string)
	GetById(id string) *model.Evictor
	GetAll() []*model.Evictor
}

type OperatorRepo

type OperatorRepo interface {
	Create(operator *model.Operator) string
	Delete(id string)
	GetById(id string) *model.Operator
	GetAll() []*model.Operator
}

type TriggerRepo

type TriggerRepo interface {
	Create(trigger *model.Trigger) string
	Delete(id string)
	GetById(id string) *model.Trigger
	GetAll() (triggerList []*model.Trigger)
}

type WindowsRepo

type WindowsRepo interface {
	Create(window *model.Window) string
	Delete(id string)
	GetById(id string) *model.Window
	GetAll() (windowsList []*model.Window)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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