ticket

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: AGPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ticket 封装工单相关操作

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Ticket)

Option 定义 Ticket 配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 Ticket bundle选项

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 Ticket 数据库选项

type Ticket

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

Ticket 工单操作封装

func New

func New(options ...Option) *Ticket

New 新建 Ticket 实例

func (*Ticket) CheckTicketPriority

func (t *Ticket) CheckTicketPriority(ticketPriority apistructs.TicketPriority) error

CheckTicketPriority 检查 ticketPriority 合法性

func (*Ticket) CheckTicketTarget

func (t *Ticket) CheckTicketTarget(ticketTarget apistructs.TicketTarget) error

CheckTicketTarget 检查 ticketTarget 合法性

func (*Ticket) CheckTicketType

func (t *Ticket) CheckTicketType(ticketType apistructs.TicketType) error

CheckTicketType 检查工单类型

func (*Ticket) Close

func (t *Ticket) Close(permission *permission.Permission, locale *i18n.LocaleResource, ticketID int64, userID user.ID) error

Close 关闭工单

func (*Ticket) CloseByKey

func (t *Ticket) CloseByKey(key string) error

CloseByKey 根据 key 关闭告警工单

func (*Ticket) Create

func (t *Ticket) Create(userID user.ID, requestID string, req *apistructs.TicketCreateRequest) (int64, error)

Create 创建工单

func (*Ticket) Delete

func (t *Ticket) Delete(targetID, targetType, ticketType string) error

Delete 删除工单

func (*Ticket) Get

func (t *Ticket) Get(permission *permission.Permission, locale *i18n.LocaleResource, ticketID int64, userID user.ID) (*apistructs.Ticket, error)

Get 获取工单详情

func (*Ticket) GetByRequestID

func (t *Ticket) GetByRequestID(requestID string) (*model.Ticket, error)

GetByRequestID 根据requestID header获取工单

func (*Ticket) GetClusterTicketsNum

func (t *Ticket) GetClusterTicketsNum(ticketType, targetType, targetID string) (uint64, error)

TODO deprecated

func (*Ticket) IsAlertType

func (t *Ticket) IsAlertType(ticketType apistructs.TicketType) bool

IsAlertType 判断 ticketType 是否为告警类型

func (*Ticket) IsSonarType

func (t *Ticket) IsSonarType(ticketType apistructs.TicketType) bool

IsSonarType 判断 ticketType 是否为sonar类型

func (*Ticket) List

List 工单列表/查询

func (*Ticket) Reopen

func (t *Ticket) Reopen(permission *permission.Permission, locale *i18n.LocaleResource, ticketID int64, userID user.ID) error

Reopen 重新打开工单

func (*Ticket) Update

func (t *Ticket) Update(permission *permission.Permission, locale *i18n.LocaleResource, ticketID int64, userID user.ID, req *apistructs.TicketUpdateRequestBody) error

Update 更新工单

Jump to

Keyboard shortcuts

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