service

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	Config *kafka.Config
	// contains filtered or unexported fields
}

Consumer .

func NewConsumer

func NewConsumer(c *conf.Config) (con *Consumer, err error)

NewConsumer .

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service struct

func New

func New(c *conf.Config) (s *Service)

New init

func (*Service) AddGroup

func (s *Service) AddGroup(c context.Context, group *model.Group) (id int64, err error)

AddGroup add a new group.

func (*Service) AddProduct

func (s *Service) AddProduct(c context.Context, p *model.Product) (id int64, err error)

AddProduct add a new group.

func (*Service) AddTarget

func (s *Service) AddTarget(c context.Context, t *model.Target) (id int64, err error)

AddTarget add a new target.

func (*Service) AllProducts

func (s *Service) AllProducts(c context.Context) (res *model.Products, err error)

AllProducts return all products.

func (*Service) Close

func (s *Service) Close()

Close .

func (*Service) Collect

func (s *Service) Collect(c context.Context, p *monitor.Log)

Collect collect.

func (*Service) DeleteGroup

func (s *Service) DeleteGroup(c context.Context, id int64) (err error)

DeleteGroup delete group.

func (*Service) DeleteProduct

func (s *Service) DeleteProduct(c context.Context, id int64) (err error)

DeleteProduct delete product.

func (*Service) DeleteTarget

func (s *Service) DeleteTarget(c context.Context, id int64) (err error)

DeleteTarget delete target by id.

func (*Service) GroupByName

func (s *Service) GroupByName(c context.Context, name string) (res *model.Group, err error)

GroupByName get group by name.

func (*Service) GroupList

func (s *Service) GroupList(c context.Context, params *model.GroupListParams) (res *model.Groups, err error)

GroupList return all groups.

func (*Service) HandleMsg

func (s *Service) HandleMsg(msg []byte)

HandleMsg .

func (*Service) PauseConsume

func (s *Service) PauseConsume(t int64) error

PauseConsume .

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping .

func (*Service) Report

func (s *Service) Report(c context.Context, params *model.LogParams, mid int64, ip string, buvid string, userAgent string) (err error)

Report .

func (*Service) StartConsume

func (s *Service) StartConsume() (err error)

StartConsume .

func (*Service) StopConsume

func (s *Service) StopConsume() error

StopConsume .

func (*Service) Target

func (s *Service) Target(c context.Context, id int64) (res *model.Target, err error)

Target get target by id.

func (*Service) TargetList

func (s *Service) TargetList(c context.Context, t *model.Target, pn int, ps int, sort string) (res *model.Targets, err error)

TargetList .

func (*Service) TargetSync

func (s *Service) TargetSync(c context.Context, id int64, state int) (err error)

TargetSync sync target state.

func (*Service) UpdateGroup

func (s *Service) UpdateGroup(c context.Context, group *model.Group) (err error)

UpdateGroup update group.

func (*Service) UpdateProduct

func (s *Service) UpdateProduct(c context.Context, p *model.Product) (err error)

UpdateProduct update product.

func (*Service) UpdateTarget

func (s *Service) UpdateTarget(c context.Context, t *model.Target) (err error)

UpdateTarget update target.

Jump to

Keyboard shortcuts

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