rulebot

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewComponent, New)

Functions

This section is empty.

Types

type Component added in v0.0.25

type Component struct {
	Conf   *config.AppConfig
	RDB    *redis.Client
	Logger log.Logger

	MessageClient     pb.MessageSvcClient
	MiddleClient      pb.MiddleSvcClient
	WorkflowSvcClient pb.WorkflowSvcClient
	StorageClient     pb.StorageSvcClient
	TodoClient        pb.TodoSvcClient
	UserClient        pb.UserSvcClient
	NLPClient         pb.NLPSvcClient
	OrgClient         pb.OrgSvcClient
	FinanceClient     pb.FinanceSvcClient
}

func (Component) Finance added in v0.1.1

func (c Component) Finance() pb.FinanceSvcClient

func (Component) GetConfig added in v0.0.25

func (c Component) GetConfig() *config.AppConfig

func (Component) GetLogger added in v0.0.25

func (c Component) GetLogger() log.Logger

func (Component) GetRedis added in v0.0.25

func (c Component) GetRedis() *redis.Client

func (Component) Message added in v0.0.25

func (c Component) Message() pb.MessageSvcClient

func (Component) Middle added in v0.0.25

func (c Component) Middle() pb.MiddleSvcClient

func (Component) NLP added in v0.0.25

func (c Component) NLP() pb.NLPSvcClient

func (Component) Org added in v0.1.1

func (c Component) Org() pb.OrgSvcClient

func (Component) Storage added in v0.0.25

func (c Component) Storage() pb.StorageSvcClient

func (Component) Todo added in v0.0.25

func (c Component) Todo() pb.TodoSvcClient

func (Component) User added in v0.0.25

func (c Component) User() pb.UserSvcClient

func (Component) Workflow added in v0.0.25

func (c Component) Workflow() pb.WorkflowSvcClient

type IComponent added in v0.0.25

type IComponent interface {
	GetConfig() *config.AppConfig
	GetRedis() *redis.Client
	GetLogger() log.Logger
	Message() pb.MessageSvcClient
	Middle() pb.MiddleSvcClient
	Workflow() pb.WorkflowSvcClient
	Storage() pb.StorageSvcClient
	Todo() pb.TodoSvcClient
	User() pb.UserSvcClient
	NLP() pb.NLPSvcClient
	Org() pb.OrgSvcClient
	Finance() pb.FinanceSvcClient
}

func NewComponent added in v0.0.25

func NewComponent(
	conf *config.AppConfig,
	rdb *redis.Client,
	logger log.Logger,

	messageClient pb.MessageSvcClient,
	middleClient pb.MiddleSvcClient,
	workflowClient pb.WorkflowSvcClient,
	storageClient pb.StorageSvcClient,
	todoClient pb.TodoSvcClient,
	userClient pb.UserSvcClient,
	nlpClient pb.NLPSvcClient,
	orgClient pb.OrgSvcClient,
	financeClient pb.FinanceSvcClient,
) IComponent

type Option

type Option func(*RuleBot)

func RegisterRuleset

func RegisterRuleset(rule RuleParser) Option

type RuleBot

type RuleBot struct {
	Comp IComponent
	// contains filtered or unexported fields
}

func CreateRuleBot added in v0.0.24

func CreateRuleBot(id string) (*RuleBot, error)

func New

func New(comp IComponent) *RuleBot

func (*RuleBot) MessageProviderOut

func (s *RuleBot) MessageProviderOut() []string

func (*RuleBot) Name

func (s *RuleBot) Name() string

func (*RuleBot) Process

func (s *RuleBot) Process(ctx context.Context, in string) *RuleBot

func (*RuleBot) SetOptions added in v0.0.24

func (s *RuleBot) SetOptions(opts ...Option)

type RuleParser

type RuleParser interface {
	Name() string
	Boot(*RuleBot)
	ParseRule(context.Context, *RuleBot, string) []string
	HelpRule(*RuleBot, string) string
}

Jump to

Keyboard shortcuts

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