bo

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 13 Imported by: 0

README

dobo说明

存放领域的bo、do

  • bo支持转model, 提供model转bo功能
  • bo和do可以互相转换
  • bo支持转api req, 提供方法API req转bo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildApiDuration

func BuildApiDuration(duration string) *api.Duration

BuildApiDuration 字符串转为api时间

func BuildApiDurationString

func BuildApiDurationString(duration *api.Duration) string

BuildApiDurationString 时间转换为字符串

func ListToApiDictSelectV1

func ListToApiDictSelectV1(values ...*DictBO) []*api.DictSelectV1

func ListToApiPromStrategySelectV1

func ListToApiPromStrategySelectV1(values ...*StrategyBO) []*api.PromStrategySelectV1

ListToApiPromStrategySelectV1 策略列表转换为api策略列表

func ListToApiPromStrategyV1

func ListToApiPromStrategyV1(values ...*StrategyBO) []*api.PromStrategyV1

ListToApiPromStrategyV1 策略列表转换为api策略列表

func Page

func Page(pgInfo Pagination) basescopes.ScopeMethod

Page 分页

func WithDefaultCurr

func WithDefaultCurr(curr int32)

WithDefaultCurr is used to set default curr

func WithDefaultSize

func WithDefaultSize(size int32)

WithDefaultSize is used to set default size

Types

type AlarmBeenNotifyMemberBO

type AlarmBeenNotifyMemberBO struct {
	ID                uint32          `json:"id"`
	RealtimeAlarmID   uint32          `json:"realtimeAlarmID"`
	Status            vobj.Status     `json:"status"`
	NotifyType        vobj.NotifyType `json:"notifyType"`
	MemberId          uint32          `json:"memberId"`
	PromAlarmNotifyID uint32          `json:"promAlarmNotifyID"`
	Msg               string          `json:"msg"`
	Member            *UserBO         `json:"member"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func (*AlarmBeenNotifyMemberBO) GetMember

func (l *AlarmBeenNotifyMemberBO) GetMember() *UserBO

GetMember 获取用户

func (*AlarmBeenNotifyMemberBO) ToApi

ToApi 转换为api

func (*AlarmBeenNotifyMemberBO) ToModel

ToModel 转换为model

type AlarmBo

type AlarmBo struct {
	Receiver          string            `json:"receiver"`
	Status            string            `json:"status"`
	Alerts            []*AlertBo        `json:"alerts"`
	GroupLabels       GroupLabels       `json:"groupLabels"`
	CommonLabels      CommonLabels      `json:"commonLabels"`
	CommonAnnotations CommonAnnotations `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	TruncatedAlerts   int32             `json:"truncatedAlerts"`
}

type AlarmHistoryBO

type AlarmHistoryBO struct {
	Id         uint32           `json:"id"`
	Md5        string           `json:"md5"`
	StrategyId uint32           `json:"strategyId"`
	StrategyBO *StrategyBO      `json:"strategyBO"`
	LevelId    uint32           `json:"levelId"`
	Level      *DictBO          `json:"level"`
	Status     vobj.AlarmStatus `json:"status"`
	StartsAt   int64            `json:"startAt"`
	EndsAt     int64            `json:"endAt"`
	Instance   string           `json:"instance"`
	Duration   int64            `json:"duration"`
	Info       *AlertBo         `json:"info"`
	CreatedAt  int64            `json:"createdAt"`
	UpdatedAt  int64            `json:"UpdatedAt"`

	// 用于回顾告警历史时候的图表查询
	Expr       string `json:"expr"`
	Datasource string `json:"datasource"`
}

func AlarmHistoryModelToBO

func AlarmHistoryModelToBO(m *do.PromAlarmHistory) *AlarmHistoryBO

AlarmHistoryModelToBO .

func (*AlarmHistoryBO) GetInfo

func (b *AlarmHistoryBO) GetInfo() *AlertBo

GetInfo .

func (*AlarmHistoryBO) GetLevel

func (b *AlarmHistoryBO) GetLevel() *DictBO

GetLevel .

func (*AlarmHistoryBO) GetStrategyBO

func (b *AlarmHistoryBO) GetStrategyBO() *StrategyBO

GetStrategyBO .

func (*AlarmHistoryBO) NewAlarmRealtimeBO

func (b *AlarmHistoryBO) NewAlarmRealtimeBO() *AlarmRealtimeBO

NewAlarmRealtimeBO .

func (*AlarmHistoryBO) String

func (b *AlarmHistoryBO) String() string

String json string

func (*AlarmHistoryBO) ToApiV1

func (b *AlarmHistoryBO) ToApiV1() *api.AlarmHistoryV1

ToApiV1 .

func (*AlarmHistoryBO) ToModel

func (b *AlarmHistoryBO) ToModel() *do.PromAlarmHistory

ToModel .

type AlarmInterveneBO

type AlarmInterveneBO struct {
	ID              uint32  `json:"id"`
	RealtimeAlarmID uint32  `json:"realtimeAlarmID"`
	UserID          uint32  `json:"userID"`
	IntervenedAt    int64   `json:"intervenedAt"`
	Remark          string  `json:"remark"`
	IntervenedUser  *UserBO `json:"intervenedUser"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func AlarmInterveneModelToBO

func AlarmInterveneModelToBO(l *do.PromAlarmIntervene) *AlarmInterveneBO

AlarmInterveneModelToBO ...

func (*AlarmInterveneBO) GetIntervenedUser

func (l *AlarmInterveneBO) GetIntervenedUser() *UserBO

GetIntervenedUser 获取干预这条信息的用户

func (*AlarmInterveneBO) ToApi

func (l *AlarmInterveneBO) ToApi() *api.InterveneInfo

ToApi ...

func (*AlarmInterveneBO) ToModel

func (l *AlarmInterveneBO) ToModel() *do.PromAlarmIntervene

ToModel ...

type AlarmMsgBo

type AlarmMsgBo struct {
	AlarmStatus  vobj.AlarmStatus    `json:"alarmStatus"`
	AlarmInfo    *AlertBo            `json:"alarmInfo"`
	StartsAt     int64               `json:"startAt"`
	EndsAt       int64               `json:"endAt"`
	StrategyBO   *StrategyBO         `json:"strategyBO"`
	PromNotifies []*NotifyBO         `json:"promNotifies"`
	Templates    []*NotifyTemplateBO `json:"template"`
}

type AlarmRealtimeBO

type AlarmRealtimeBO struct {
	ID                   uint32                            `json:"id"`
	Instance             string                            `json:"instance"`
	Note                 string                            `json:"note"`
	LevelId              uint32                            `json:"levelId"`
	Level                *DictBO                           `json:"level"`
	EventAt              int64                             `json:"eventAt"`
	Status               vobj.AlarmStatus                  `json:"status"`
	AlarmIntervenes      []*AlarmInterveneBO               `json:"alarmIntervenes"`
	BeNotifyMemberDetail []*AlarmBeenNotifyMemberBO        `json:"beNotifyMemberDetail"`
	NotifiedAt           int64                             `json:"notifiedAt"`
	HistoryID            uint32                            `json:"historyId"`
	AlarmUpgradeInfo     *AlarmUpgradeBO                   `json:"alarmUpgradeInfo"`
	AlarmSuppressInfo    *AlarmSuppressBO                  `json:"alarmSuppressInfo"`
	StrategyID           uint32                            `json:"strategyId"`
	Strategy             *StrategyBO                       `json:"strategy"`
	BeNotifiedChatGroups []*PromAlarmBeenNotifyChatGroupBO `json:"beNotifiedChatGroups"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func AlarmRealtimeModelToBO

func AlarmRealtimeModelToBO(m *do.PromAlarmRealtime) *AlarmRealtimeBO

AlarmRealtimeModelToBO 将model转为BO对象

func (*AlarmRealtimeBO) Bytes

func (l *AlarmRealtimeBO) Bytes() []byte

func (*AlarmRealtimeBO) GetAlarmIntervenes

func (l *AlarmRealtimeBO) GetAlarmIntervenes() []*AlarmInterveneBO

GetAlarmIntervenes 获取告警干预详情

func (*AlarmRealtimeBO) GetAlarmSuppressInfo

func (l *AlarmRealtimeBO) GetAlarmSuppressInfo() *AlarmSuppressBO

GetAlarmSuppressInfo 获取告警抑制详情

func (*AlarmRealtimeBO) GetAlarmUpgradeInfo

func (l *AlarmRealtimeBO) GetAlarmUpgradeInfo() *AlarmUpgradeBO

GetAlarmUpgradeInfo 获取告警升级详情

func (*AlarmRealtimeBO) GetBeNotifiedChatGroups

func (l *AlarmRealtimeBO) GetBeNotifiedChatGroups() []*PromAlarmBeenNotifyChatGroupBO

GetBeNotifiedChatGroups 获取通知群组详情

func (*AlarmRealtimeBO) GetBeNotifyMemberDetail

func (l *AlarmRealtimeBO) GetBeNotifyMemberDetail() []*AlarmBeenNotifyMemberBO

GetBeNotifyMemberDetail 获取通知成员详情

func (*AlarmRealtimeBO) GetLevel

func (l *AlarmRealtimeBO) GetLevel() *DictBO

GetLevel 获取告警等级详情

func (*AlarmRealtimeBO) GetStrategy

func (l *AlarmRealtimeBO) GetStrategy() *StrategyBO

GetStrategy 获取策略详情

func (*AlarmRealtimeBO) MarshalBinary

func (l *AlarmRealtimeBO) MarshalBinary() (data []byte, err error)

func (*AlarmRealtimeBO) String

func (l *AlarmRealtimeBO) String() string

String json string

func (*AlarmRealtimeBO) ToApi

ToApi 将BO转为API对象

func (*AlarmRealtimeBO) ToModel

func (l *AlarmRealtimeBO) ToModel() *do.PromAlarmRealtime

func (*AlarmRealtimeBO) UnmarshalBinary

func (l *AlarmRealtimeBO) UnmarshalBinary(data []byte) error

type AlarmSuppressBO

type AlarmSuppressBO struct {
	ID              uint32  `json:"id"`
	RealtimeAlarmID uint32  `json:"realtimeAlarmID"`
	UserID          uint32  `json:"userID"`
	SuppressedAt    int64   `json:"suppressedAt"`
	Remark          string  `json:"remark"`
	Duration        int64   `json:"duration"`
	User            *UserBO `json:"user"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func AlarmSuppressModelToBO

func AlarmSuppressModelToBO(m *do.PromAlarmSuppress) *AlarmSuppressBO

AlarmSuppressModelToBO model转换为bo

func (*AlarmSuppressBO) GetUser

func (l *AlarmSuppressBO) GetUser() *UserBO

GetUser 获取用户

func (*AlarmSuppressBO) ToApi

ToApi 转换为api

func (*AlarmSuppressBO) ToModel

func (l *AlarmSuppressBO) ToModel() *do.PromAlarmSuppress

ToModel 转换为model

type AlarmUpgradeBO

type AlarmUpgradeBO struct {
	ID              uint32  `json:"id"`
	RealtimeAlarmID uint32  `json:"realtimeAlarmID"`
	UserID          uint32  `json:"userID"`
	UpgradedAt      int64   `json:"upgradedAt"`
	Remark          string  `json:"remark"`
	User            *UserBO `json:"user"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func AlarmUpgradeModelToBO

func AlarmUpgradeModelToBO(m *do.PromAlarmUpgrade) *AlarmUpgradeBO

AlarmUpgradeModelToBO .

func (*AlarmUpgradeBO) GetUser

func (l *AlarmUpgradeBO) GetUser() *UserBO

GetUser 获取用户

func (*AlarmUpgradeBO) MarshalBinary

func (l *AlarmUpgradeBO) MarshalBinary() (data []byte, err error)

func (*AlarmUpgradeBO) ToApi

func (l *AlarmUpgradeBO) ToApi() *api.AlarmUpgradeInfo

ToApi 转换为api

func (*AlarmUpgradeBO) ToModel

func (l *AlarmUpgradeBO) ToModel() *do.PromAlarmUpgrade

ToModel 转换为model

func (*AlarmUpgradeBO) UnmarshalBinary

func (l *AlarmUpgradeBO) UnmarshalBinary(data []byte) error

type AlertBo

type AlertBo struct {
	Status       string                `json:"status"`
	Labels       *strategy.Labels      `json:"labels"`
	Annotations  *strategy.Annotations `json:"annotations"`
	StartsAt     string                `json:"startsAt"`
	EndsAt       string                `json:"endsAt"`
	GeneratorURL string                `json:"generatorURL"`
	Fingerprint  string                `json:"fingerprint"`
	Value        float64               `json:"value"`
}

func StringToAlertBo

func StringToAlertBo(str string) *AlertBo

StringToAlertBo .

func (*AlertBo) Bytes

func (b *AlertBo) Bytes() []byte

Bytes .

func (*AlertBo) GetAnnotations

func (b *AlertBo) GetAnnotations() *strategy.Annotations

GetAnnotations .

func (*AlertBo) GetLabels

func (b *AlertBo) GetLabels() *strategy.Labels

GetLabels .

func (*AlertBo) GetStatus

func (b *AlertBo) GetStatus() string

GetStatus .

func (*AlertBo) String

func (b *AlertBo) String() string

String .

func (*AlertBo) ToAnnotationsMap

func (b *AlertBo) ToAnnotationsMap() map[string]string

ToAnnotationsMap .

func (*AlertBo) ToLabelsMap

func (b *AlertBo) ToLabelsMap() map[string]string

ToLabelsMap .

func (*AlertBo) ToMap

func (b *AlertBo) ToMap() map[string]any

ToMap .

type ApiBO

type ApiBO struct {
	Id     uint32      `json:"id"`
	Name   string      `json:"name"`
	Path   string      `json:"path"`
	Method string      `json:"method"`
	Status vobj.Status `json:"status"`
	Remark string      `json:"remark"`
	Module vobj.Module `json:"module"`
	Domain vobj.Domain `json:"domain"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func ApiModelToBO

func ApiModelToBO(m *do.SysAPI) *ApiBO

ApiModelToBO .

func (*ApiBO) String

func (b *ApiBO) String() string

String json string

func (*ApiBO) ToApiSelectV1

func (b *ApiBO) ToApiSelectV1() *api.ApiSelectV1

ToApiSelectV1 .

func (*ApiBO) ToApiV1

func (b *ApiBO) ToApiV1() *api.ApiV1

ToApiV1 .

func (*ApiBO) ToModel

func (b *ApiBO) ToModel() *do.SysAPI

ToModel .

type ApiListApiReq

type ApiListApiReq struct {
	Keyword string      `json:"keyword"`
	Status  vobj.Status `json:"status"`
	Curr    int32       `json:"curr"`
	Size    int32       `json:"size"`
}

type CaptchaBO

type CaptchaBO struct {
	Id       string `json:"id"`
	Value    string `json:"value"`
	Image    string `json:"image"`
	ExpireAt int64  `json:"expireAt"`
}

func (*CaptchaBO) Bytes

func (c *CaptchaBO) Bytes() []byte

Bytes 用于redis映射

func (*CaptchaBO) MarshalBinary

func (c *CaptchaBO) MarshalBinary() (data []byte, err error)

MarshalBinary 用于redis映射

func (*CaptchaBO) UnmarshalBinary

func (c *CaptchaBO) UnmarshalBinary(data []byte) error

UnmarshalBinary 用于redis映射

type ChangeLogBo

type ChangeLogBo struct {
	Old any `json:"old"`
	New any `json:"new"`
}

func NewChangeLogBo

func NewChangeLogBo(old, new any) *ChangeLogBo

func (*ChangeLogBo) String

func (l *ChangeLogBo) String() string

String json string

type ChatGroupBO

type ChatGroupBO struct {
	Id        uint32         `json:"id"`
	Name      string         `json:"name"`
	Status    vobj.Status    `json:"status"`
	Remark    string         `json:"remark"`
	CreatedAt int64          `json:"createdAt"`
	UpdatedAt int64          `json:"updatedAt"`
	DeletedAt int64          `json:"deletedAt"`
	Hook      string         `json:"hook"`
	NotifyApp vobj.NotifyApp `json:"notifyApp"`
	HookName  string         `json:"hookName"`
	// 通信密钥
	Secret string `json:"secret"`

	// 创建者
	CreateUser *UserBO `json:"createUser"`
}

func ChatGroupApiToBO

func ChatGroupApiToBO(a *api.ChatGroup) *ChatGroupBO

ChatGroupApiToBO ...

func ChatGroupModelToBO

func ChatGroupModelToBO(m *do.PromAlarmChatGroup) *ChatGroupBO

ChatGroupModelToBO .

func (*ChatGroupBO) GetCreateUser

func (b *ChatGroupBO) GetCreateUser() *UserBO

GetCreateUser .

func (*ChatGroupBO) String

func (b *ChatGroupBO) String() string

String json string

func (*ChatGroupBO) ToApi

func (b *ChatGroupBO) ToApi() *api.ChatGroup

ToApi ...

func (*ChatGroupBO) ToModel

func (b *ChatGroupBO) ToModel() *do.PromAlarmChatGroup

func (*ChatGroupBO) ToSelectApi

func (b *ChatGroupBO) ToSelectApi() *api.ChatGroupSelectV1

ToSelectApi ...

type CommonAnnotations

type CommonAnnotations map[string]string

type CommonLabels

type CommonLabels map[string]string

type CreateEndpointReq

type CreateEndpointReq struct {
	Name     string `json:"name"`
	Endpoint string `json:"endpoint"`
	Remark   string `json:"remark"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type DictBO

type DictBO struct {
	Id        uint32        `json:"id"`
	Name      string        `json:"name"`
	Category  vobj.Category `json:"category"`
	Status    vobj.Status   `json:"status"`
	Remark    string        `json:"remark"`
	Color     string        `json:"color"`
	CreatedAt int64         `json:"createdAt"`
	UpdatedAt int64         `json:"updatedAt"`
	DeletedAt int64         `json:"deletedAt"`
}

func DictModelToBO

func DictModelToBO(m *do.SysDict) *DictBO

DictModelToBO 字典model数据对象转换为字典业务对象

func (*DictBO) String

func (d *DictBO) String() string

String json string

func (*DictBO) ToApiSelectV1

func (d *DictBO) ToApiSelectV1() *api.DictSelectV1

ToApiSelectV1 转换为api字典查询对象

func (*DictBO) ToApiV1

func (d *DictBO) ToApiV1() *api.DictV1

ToApiV1 转换为api字典对象

func (*DictBO) ToModel

func (d *DictBO) ToModel() *do.SysDict

type EndpointBO

type EndpointBO struct {
	Id        uint32              `json:"id"`
	Name      string              `json:"name"`
	Endpoint  string              `json:"endpoint"`
	Status    vobj.Status         `json:"status"`
	Remark    string              `json:"remark"`
	CreatedAt int64               `json:"createdAt"`
	UpdatedAt int64               `json:"updatedAt"`
	DeletedAt int64               `json:"deletedAt"`
	BasicAuth *strategy.BasicAuth `json:"basicAuth"`
}

func EndpointModelToBO

func EndpointModelToBO(m *do.Endpoint) *EndpointBO

EndpointModelToBO do.PromEndpoint to EndpointBO

func (*EndpointBO) GetBasicAuth

func (l *EndpointBO) GetBasicAuth() *strategy.BasicAuth

GetBasicAuth get basic auth

func (*EndpointBO) MarshalBinary

func (l *EndpointBO) MarshalBinary() (data []byte, err error)

func (*EndpointBO) String

func (l *EndpointBO) String() string

String json string

func (*EndpointBO) ToApiSelectV1

func (l *EndpointBO) ToApiSelectV1() *api.PrometheusServerSelectItem

func (*EndpointBO) ToApiV1

func (l *EndpointBO) ToApiV1() *api.PrometheusServerItem

func (*EndpointBO) ToModel

func (l *EndpointBO) ToModel() *do.Endpoint

ToModel EndpointBO to do.PromEndpoint

func (*EndpointBO) UnmarshalBinary

func (l *EndpointBO) UnmarshalBinary(data []byte) error

type ExportStrategyRequest

type ExportStrategyRequest struct {
	Ids []uint32
}

type ExternalCustomerBO

type ExternalCustomerBO struct {
	Id      uint32                    `json:"id"`
	Name    string                    `json:"name"`
	Address string                    `json:"address"`
	Contact string                    `json:"contact"`
	Phone   string                    `json:"phone"`
	Email   string                    `json:"email"`
	Remark  string                    `json:"remark"`
	Status  vobj.Status               `json:"status"`
	Hooks   []*ExternalCustomerHookBO `json:"hooks"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func ExternalCustomerModelToBO

func ExternalCustomerModelToBO(m *do.ExternalCustomer) *ExternalCustomerBO

ExternalCustomerModelToBO 模型转换为BO

func (*ExternalCustomerBO) GetHooks

func (d *ExternalCustomerBO) GetHooks() []*ExternalCustomerHookBO

GetHooks 获取钩子列表

func (*ExternalCustomerBO) String

func (d *ExternalCustomerBO) String() string

String json string

func (*ExternalCustomerBO) ToApi

func (*ExternalCustomerBO) ToModel

func (d *ExternalCustomerBO) ToModel() *do.ExternalCustomer

ToModel 转换为模型

type ExternalCustomerHookBO

type ExternalCustomerHookBO struct {
	Id         uint32              `json:"id"`
	Hook       string              `json:"hook"`
	HookName   string              `json:"hookName"`
	NotifyApp  vobj.NotifyApp      `json:"notifyApp"`
	Status     vobj.Status         `json:"status"`
	Remark     string              `json:"remark"`
	CustomerId uint32              `json:"customerId"`
	Customer   *ExternalCustomerBO `json:"externalCustomer"`
	CreatedAt  int64               `json:"createdAt"`
	UpdatedAt  int64               `json:"updatedAt"`
	DeletedAt  int64               `json:"deletedAt"`
}

func ExternalCustomerHookModelToBO

func ExternalCustomerHookModelToBO(m *do.ExternalCustomerHook) *ExternalCustomerHookBO

ExternalCustomerHookModelToBO 模型转换为BO

func (*ExternalCustomerHookBO) GetCustomer

func (d *ExternalCustomerHookBO) GetCustomer() *ExternalCustomerBO

GetCustomer 获取外部客户

func (*ExternalCustomerHookBO) String

func (d *ExternalCustomerHookBO) String() string

String json string

func (*ExternalCustomerHookBO) ToApi

ToApi 转换为API

func (*ExternalCustomerHookBO) ToModel

ToModel 转换为模型

type ExternalNotifyObjBO

type ExternalNotifyObjBO struct {
	Id               uint32                    `json:"id"`
	Name             string                    `json:"name"`
	Remark           string                    `json:"remark"`
	Status           vobj.Status               `json:"status"`
	CustomerList     []*ExternalCustomerBO     `json:"externalCustomerList"`
	CustomerHookList []*ExternalCustomerHookBO `json:"externalCustomerHookList"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func ExternalNotifyObjModelToBO

func ExternalNotifyObjModelToBO(m *do.ExternalNotifyObj) *ExternalNotifyObjBO

ExternalNotifyObjModelToBO 将模型转换为对象

func (*ExternalNotifyObjBO) GetCustomerHookList

func (d *ExternalNotifyObjBO) GetCustomerHookList() []*ExternalCustomerHookBO

GetCustomerHookList 获取客户钩子列表

func (*ExternalNotifyObjBO) GetCustomerList

func (d *ExternalNotifyObjBO) GetCustomerList() []*ExternalCustomerBO

GetCustomerList 获取客户列表

func (*ExternalNotifyObjBO) String

func (d *ExternalNotifyObjBO) String() string

String json string

func (*ExternalNotifyObjBO) ToApi

ToApi 将对象转换为API

func (*ExternalNotifyObjBO) ToModel

ToModel 将对象转换为模型

type GetUserListReq

type GetUserListReq struct {
	Page    Pagination
	Keyword string      `json:"keyword"`
	Status  vobj.Status `json:"status"`
}

type GroupLabels

type GroupLabels map[string]string

type ListChatGroupReq

type ListChatGroupReq struct {
	Page    Pagination     `json:"page"`
	Keyword string         `json:"keyword"`
	Status  vobj.Status    `json:"status"`
	App     vobj.NotifyApp `json:"app"`
}

type ListDashboardReq

type ListDashboardReq struct {
	Page    Pagination  `json:"page"`
	Keyword string      `json:"keyword"`
	Status  vobj.Status `json:"status"`
}

type ListDictRequest

type ListDictRequest struct {
	Page      Pagination    `json:"page"`
	Keyword   string        `json:"keyword"`
	Category  vobj.Category `json:"category"`
	Status    vobj.Status   `json:"status"`
	IsDeleted bool          `json:"isDeleted"`
}

type ListEndpointReq

type ListEndpointReq struct {
	Page    Pagination
	Keyword string
	Status  vobj.Status
}

type ListGroupReq

type ListGroupReq struct {
	Page              Pagination  `json:"page"`
	Keyword           string      `json:"keyword"`
	Status            vobj.Status `json:"status"`
	PreloadCategories bool        `json:"preloadCategories"`
	Ids               []uint32    `json:"ids"`
	CategoryIds       []uint32    `json:"categoryIds"`
}

type ListHistoryRequest

type ListHistoryRequest struct {
	Page            Pagination
	Keyword         string
	FiringStartAt   int64
	FiringEndAt     int64
	ResolvedStartAt int64
	ResolvedEndAt   int64
	Status          vobj.AlarmStatus
	AlarmPageIds    []uint32
	StrategyIds     []uint32
	AlarmLevelIds   []uint32
	Duration        int64
}

type ListNotifyRequest

type ListNotifyRequest struct {
	Page    Pagination  `json:"page"`
	Keyword string      `json:"keyword"`
	Status  vobj.Status `json:"status"`
}

type ListRealtimeReq

type ListRealtimeReq struct {
	Page        Pagination       `json:"page"`
	Keyword     string           `json:"keyword"`
	Status      vobj.AlarmStatus `json:"status"`
	AlarmPageId uint32           `json:"alarm_page_id"`
	StrategyIds []uint32         `json:"strategyIds"`
	LevelIds    []uint32         `json:"levelIds"`
	StartAt     int64            `json:"startAt"`
	EndAt       int64            `json:"endAt"`
}

type ListRoleReq

type ListRoleReq struct {
	Page    Pagination  `json:"page"`
	Status  vobj.Status `json:"status"`
	Keyword string      `json:"keyword"`
	UserId  uint32      `json:"user_id"`
}

type ListStrategyRequest

type ListStrategyRequest struct {
	Page       Pagination
	Keyword    string
	GroupId    uint32
	Status     vobj.Status
	StrategyId uint32
}

type ListSyslogReq

type ListSyslogReq struct {
	Page     Pagination
	Module   vobj.Module
	ModuleId uint32
}

type MyChartBO

type MyChartBO struct {
	Id     uint32      `json:"id"`
	UserId uint32      `json:"userId"`
	Title  string      `json:"title"`
	Remark string      `json:"remark"`
	Url    string      `json:"url"`
	Status vobj.Status `json:"status"`
}

func MyChartModelToBO

func MyChartModelToBO(m *do.MyChart) *MyChartBO

MyChartModelToBO 转换为bo数据

func (*MyChartBO) String

func (b *MyChartBO) String() string

String json string

func (*MyChartBO) ToApi

func (b *MyChartBO) ToApi() *api.MyChart

ToApi 转换为api数据

func (*MyChartBO) ToApiSelectV1

func (b *MyChartBO) ToApiSelectV1() *api.MyChart

ToApiSelectV1 转换为api数据

func (*MyChartBO) ToModel

func (b *MyChartBO) ToModel() *do.MyChart

ToModel 转换为model数据

type MyDashboardConfigBO

type MyDashboardConfigBO struct {
	Id     uint32       `json:"id"`
	Status vobj.Status  `json:"status"`
	Remark string       `json:"remark"`
	Title  string       `json:"title"`
	Color  string       `json:"color"`
	UserId uint32       `json:"userId"`
	Charts []*MyChartBO `json:"charts"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func MyDashboardConfigModelToBO

func MyDashboardConfigModelToBO(m *do.MyDashboardConfig) *MyDashboardConfigBO

MyDashboardConfigModelToBO 实体转换业务对象

func (*MyDashboardConfigBO) GetCharts

func (l *MyDashboardConfigBO) GetCharts() []*MyChartBO

GetCharts 获取图表列表

func (*MyDashboardConfigBO) String

func (l *MyDashboardConfigBO) String() string

String json string

func (*MyDashboardConfigBO) ToApi

ToApi 转换为API查询对象

func (*MyDashboardConfigBO) ToApiSelectV1

func (l *MyDashboardConfigBO) ToApiSelectV1() *api.MyDashboardConfigOption

ToApiSelectV1 转换为API查询对象

func (*MyDashboardConfigBO) ToModel

ToModel 转换为实体

type NotifyBO

type NotifyBO struct {
	Id                 uint32                 `json:"id"`
	Name               string                 `json:"name"`
	Status             vobj.Status            `json:"status"`
	Remark             string                 `json:"remark"`
	CreatedAt          int64                  `json:"createdAt"`
	UpdatedAt          int64                  `json:"updatedAt"`
	DeletedAt          int64                  `json:"deletedAt"`
	ChatGroups         []*ChatGroupBO         `json:"chatGroups"`
	BeNotifyMembers    []*NotifyMemberBO      `json:"beNotifyMembers"`
	ExternalNotifyObjs []*ExternalNotifyObjBO `json:"externalNotifyObjs"`
}

func NotifyModelToBO

func NotifyModelToBO(m *do.PromAlarmNotify) *NotifyBO

NotifyModelToBO ...

func (*NotifyBO) GetBeNotifyMembers

func (d *NotifyBO) GetBeNotifyMembers() []*NotifyMemberBO

GetBeNotifyMembers 获取通知的成员

func (*NotifyBO) GetChatGroups

func (d *NotifyBO) GetChatGroups() []*ChatGroupBO

GetChatGroups 获取通知的群组

func (*NotifyBO) GetExternalNotifyObjs

func (d *NotifyBO) GetExternalNotifyObjs() []*ExternalNotifyObjBO

GetExternalNotifyObjs 获取通知的外部体系通知对象

func (*NotifyBO) String

func (d *NotifyBO) String() string

String json string

func (*NotifyBO) ToApi

func (d *NotifyBO) ToApi() *api.NotifyV1

ToApi ...

func (*NotifyBO) ToApiSelectV1

func (d *NotifyBO) ToApiSelectV1() *api.NotifySelectV1

ToApiSelectV1 ...

func (*NotifyBO) ToModel

func (d *NotifyBO) ToModel() *do.PromAlarmNotify

ToModel ...

type NotifyMemberBO

type NotifyMemberBO struct {
	Id         uint32          `json:"id"`
	Status     vobj.Status     `json:"status"`
	CreatedAt  int64           `json:"createdAt"`
	UpdatedAt  int64           `json:"updatedAt"`
	DeletedAt  int64           `json:"deletedAt"`
	MemberId   uint32          `json:"memberId"`
	Member     *UserBO         `json:"member"`
	NotifyType vobj.NotifyType `json:"notifyTypes"`
}

func NotifyMemberApiToBO

func NotifyMemberApiToBO(a *api.BeNotifyMember) *NotifyMemberBO

NotifyMemberApiToBO ...

func NotifyMemberModelToBO

func NotifyMemberModelToBO(m *do.PromAlarmNotifyMember) *NotifyMemberBO

NotifyMemberModelToBO ...

func (*NotifyMemberBO) GetMember

func (b *NotifyMemberBO) GetMember() *UserBO

GetMember 获取用户详情

func (*NotifyMemberBO) String

func (b *NotifyMemberBO) String() string

String json string

func (*NotifyMemberBO) ToApi

ToApi ...

func (*NotifyMemberBO) ToModel

func (b *NotifyMemberBO) ToModel() *do.PromAlarmNotifyMember

type NotifyTemplateBO

type NotifyTemplateBO struct {
	Id         uint32                  `json:"id"`
	StrategyID uint32                  `json:"strategyID"`
	NotifyType vobj.NotifyTemplateType `json:"notifyType"`
	Content    string                  `json:"content"`
}

func NotifyTemplateModelToBO

func NotifyTemplateModelToBO(m *do.PromStrategyNotifyTemplate) *NotifyTemplateBO

NotifyTemplateModelToBO 转换

func (*NotifyTemplateBO) ToApi

ToApi NotifyTemplateBO to api

func (*NotifyTemplateBO) ToModel

ToModel NotifyTemplateBO to model

type NotifyTemplateCreateBO

type NotifyTemplateCreateBO struct {
	Content    string                  `json:"content"`
	StrategyID uint32                  `json:"strategyID"`
	NotifyType vobj.NotifyTemplateType `json:"notifyType"`
}

type NotifyTemplateListBo

type NotifyTemplateListBo struct {
	Page       Pagination `json:"page"`
	StrategyId uint32     `json:"strategyId"`
}

type NotifyTemplateUpdateBo

type NotifyTemplateUpdateBo struct {
	Id         uint32                  `json:"id"`
	Content    string                  `json:"content"`
	StrategyID uint32                  `json:"strategyID"`
	NotifyType vobj.NotifyTemplateType `json:"notifyType"`
}

type Pagination

type Pagination interface {
	GetCurr() int32
	GetRespCurr() int32
	GetSize() int32
	SetTotal(total int64)
	GetTotal() int64
}

func NewPage

func NewPage(curr, size int32) Pagination

type Ping

type Ping struct {
	Hello string `json:"hello"`
}

Ping is a Ping model.

type PromAlarmBeenNotifyChatGroupBO

type PromAlarmBeenNotifyChatGroupBO struct {
	ID                uint32       `json:"id"`
	Status            vobj.Status  `json:"status"`
	Msg               string       `json:"msg"`
	PromAlarmNotifyID uint32       `json:"promAlarmNotifyID"`
	RealtimeAlarmID   uint32       `json:"realtimeAlarmID"`
	ChatGroup         *ChatGroupBO `json:"chatGroup"`
	ChatGroupId       uint32       `json:"chatGroupId"`

	CreatedAt int64 `json:"createdAt"`
	UpdatedAt int64 `json:"updatedAt"`
	DeletedAt int64 `json:"deletedAt"`
}

func PromAlarmBeenNotifyChatGroupModelToBO

func PromAlarmBeenNotifyChatGroupModelToBO(m *do.PromAlarmBeenNotifyChatGroup) *PromAlarmBeenNotifyChatGroupBO

PromAlarmBeenNotifyChatGroupModelToBO 转换为业务对象

func (*PromAlarmBeenNotifyChatGroupBO) GetChatGroup

func (l *PromAlarmBeenNotifyChatGroupBO) GetChatGroup() *ChatGroupBO

GetChatGroup .

func (*PromAlarmBeenNotifyChatGroupBO) ToApi

ToApi 转换为api对象

func (*PromAlarmBeenNotifyChatGroupBO) ToModel

ToModel 转换为模型

type RemoveStrategyGroupBO

type RemoveStrategyGroupBO struct {
	Id uint32 `json:"id"`
}

type RoleBO

type RoleBO struct {
	Id        uint32      `json:"id"`
	Name      string      `json:"name"`
	Status    vobj.Status `json:"status"`
	Remark    string      `json:"remark"`
	CreatedAt int64       `json:"createdAt"`
	UpdatedAt int64       `json:"updatedAt"`
	DeletedAt int64       `json:"deletedAt"`
	Users     []*UserBO   `json:"users"`
	Apis      []*ApiBO    `json:"apis"`
}

func RoleModelToBO

func RoleModelToBO(m *do.SysRole) *RoleBO

RoleModelToBO .

func (*RoleBO) ApiRoleSelectV1

func (l *RoleBO) ApiRoleSelectV1() *api.RoleSelectV1

func (*RoleBO) GetApis

func (l *RoleBO) GetApis() []*ApiBO

GetApis 获取api列表

func (*RoleBO) GetUsers

func (l *RoleBO) GetUsers() []*UserBO

GetUsers 获取用户列表

func (*RoleBO) String

func (l *RoleBO) String() string

String json string

func (*RoleBO) ToApiV1

func (l *RoleBO) ToApiV1() *api.RoleV1

func (*RoleBO) ToModel

func (l *RoleBO) ToModel() *do.SysRole

type SelectStrategyRequest

type SelectStrategyRequest struct {
	Page    Pagination
	Keyword string
	Status  vobj.Status
}

type StrategyBO

type StrategyBO struct {
	Id             uint32                `json:"id"`
	Alert          string                `json:"alert"`
	Expr           string                `json:"expr"`
	Duration       string                `json:"duration"`
	Labels         *strategy.Labels      `json:"labels"`
	Annotations    *strategy.Annotations `json:"annotations"`
	Status         vobj.Status           `json:"status"`
	Remark         string                `json:"remark"`
	GroupId        uint32                `json:"groupId"`
	GroupInfo      *StrategyGroupBO      `json:"groupInfo"`
	AlarmLevelId   uint32                `json:"alarmLevelId"`
	AlarmLevelInfo *DictBO               `json:"alarmLevelInfo"`
	AlarmPageIds   []uint32              `json:"alarmPageIds"`
	AlarmPages     []*DictBO             `json:"alarmPages"`
	CategoryIds    []uint32              `json:"categoryIds"`
	Categories     []*DictBO             `json:"categories"`
	CreatedAt      int64                 `json:"createdAt"`
	UpdatedAt      int64                 `json:"updatedAt"`
	DeletedAt      int64                 `json:"deletedAt"`

	PromNotifies      []*NotifyBO `json:"promNotifies"`
	PromNotifyIds     []uint32    `json:"promNotifyIds"`
	PromNotifyUpgrade []*NotifyBO `json:"promNotifyUpgrade"`

	EndpointId uint32      `json:"endpointId"`
	Endpoint   *EndpointBO `json:"endpoint"`

	MaxSuppress  string             `json:"maxSuppress"`
	SendInterval string             `json:"sendInterval"`
	SendRecover  vobj.IsSendRecover `json:"sendRecover"`

	Templates []*NotifyTemplateBO `json:"templates"`
}

func StrategyModelToBO

func StrategyModelToBO(m *do.PromStrategy) *StrategyBO

StrategyModelToBO .

func (*StrategyBO) CategoryInfoToApiSelectV1

func (b *StrategyBO) CategoryInfoToApiSelectV1() []*api.DictSelectV1

CategoryInfoToApiSelectV1 分类信息转换为api分类列表

func (*StrategyBO) GetAlarmLevelInfo

func (b *StrategyBO) GetAlarmLevelInfo() *DictBO

GetAlarmLevelInfo 获取告警级别信息

func (*StrategyBO) GetAlarmPageIds

func (b *StrategyBO) GetAlarmPageIds() []uint32

GetAlarmPageIds 获取告警页面ID列表

func (*StrategyBO) GetAlarmPages

func (b *StrategyBO) GetAlarmPages() []*DictBO

GetAlarmPages .

func (*StrategyBO) GetAlert

func (b *StrategyBO) GetAlert() string

GetAlert .

func (*StrategyBO) GetAnnotations

func (b *StrategyBO) GetAnnotations() *strategy.Annotations

GetAnnotations 获取注解

func (*StrategyBO) GetCategories

func (b *StrategyBO) GetCategories() []*DictBO

GetCategories 获取分类信息列表

func (*StrategyBO) GetCategoryIds

func (b *StrategyBO) GetCategoryIds() []uint32

GetCategoryIds 获取分类ID列表

func (*StrategyBO) GetEndpoint

func (b *StrategyBO) GetEndpoint() *EndpointBO

GetEndpoint 获取Endpoint

func (*StrategyBO) GetGroupInfo

func (b *StrategyBO) GetGroupInfo() *StrategyGroupBO

GetGroupInfo 获取分组信息

func (*StrategyBO) GetLabels

func (b *StrategyBO) GetLabels() *strategy.Labels

GetLabels 获取标签

func (*StrategyBO) GetPromNotifies

func (b *StrategyBO) GetPromNotifies() []*NotifyBO

GetPromNotifies 获取通知信息列表

func (*StrategyBO) GetPromNotifyUpgrade

func (b *StrategyBO) GetPromNotifyUpgrade() []*NotifyBO

GetPromNotifyUpgrade 获取告警升级通知信息列表

func (*StrategyBO) GetTemplates

func (b *StrategyBO) GetTemplates() []*NotifyTemplateBO

GetTemplates 获取通知模板列表

func (*StrategyBO) String

func (b *StrategyBO) String() string

String json string

func (*StrategyBO) ToApiPromStrategySelectV1

func (b *StrategyBO) ToApiPromStrategySelectV1() *api.PromStrategySelectV1

ToApiPromStrategySelectV1 策略转换为api策略

func (*StrategyBO) ToApiSelectV1

func (b *StrategyBO) ToApiSelectV1() []*api.DictSelectV1

ToApiSelectV1 告警页面列表转换为api告警页面列表

func (*StrategyBO) ToApiV1

func (b *StrategyBO) ToApiV1() *api.PromStrategyV1

ToApiV1 策略转换为api策略

func (*StrategyBO) ToModel

func (b *StrategyBO) ToModel() *do.PromStrategy

func (*StrategyBO) ToSimpleApi

func (b *StrategyBO) ToSimpleApi() *api.StrategySimple

ToSimpleApi .

type StrategyGroupBO

type StrategyGroupBO struct {
	Id                  uint32      `json:"id"`
	Name                string      `json:"name"`
	Remark              string      `json:"remark"`
	Status              vobj.Status `json:"status"`
	StrategyCount       int64       `json:"strategyCount"`
	EnableStrategyCount int64       `json:"enableStrategyCount"`
	CategoryIds         []uint32    `json:"categoryIds"`
	Categories          []*DictBO   `json:"categories"`
	CreatedAt           int64       `json:"createdAt"`
	UpdatedAt           int64       `json:"updatedAt"`
	DeletedAt           int64       `json:"deletedAt"`

	PromStrategies []*StrategyBO `json:"promStrategies"`
}

func StrategyGroupModelToBO

func StrategyGroupModelToBO(m *do.PromStrategyGroup) *StrategyGroupBO

StrategyGroupModelToBO .

func (*StrategyGroupBO) GetCategories

func (b *StrategyGroupBO) GetCategories() []*DictBO

GetCategories 获取分类列表

func (*StrategyGroupBO) GetCategoryIds

func (b *StrategyGroupBO) GetCategoryIds() []uint32

GetCategoryIds 获取分类ID列表

func (*StrategyGroupBO) GetPromStrategies

func (b *StrategyGroupBO) GetPromStrategies() []*StrategyBO

GetPromStrategies 获取策略列表

func (*StrategyGroupBO) String

func (b *StrategyGroupBO) String() string

String json string

func (*StrategyGroupBO) ToApiSelectV1

func (b *StrategyGroupBO) ToApiSelectV1() *api.PromGroupSelectV1

ToApiSelectV1 .

func (*StrategyGroupBO) ToApiV1

func (b *StrategyGroupBO) ToApiV1() *api.PromGroup

ToApiV1 .

func (*StrategyGroupBO) ToModel

func (b *StrategyGroupBO) ToModel() *do.PromStrategyGroup

func (*StrategyGroupBO) ToSimpleApi

func (b *StrategyGroupBO) ToSimpleApi() *api.GroupSimple

ToSimpleApi .

type SysLogBo

type SysLogBo struct {
	ModuleName vobj.Module `json:"moduleName"`
	ModuleId   uint32      `json:"moduleId"`
	Content    string      `json:"content"`
	Title      string      `json:"title"`
	Action     vobj.Action `json:"action"`
	CreatedAt  int64       `json:"createdAt"`
	Id         uint32      `json:"id"`
	UserId     uint32      `json:"userId"`
	User       *UserBO     `json:"user"`
}

func SysLogModelToBo

func SysLogModelToBo(m *do.SysLog) *SysLogBo

SysLogModelToBo .

func (*SysLogBo) GetUser

func (l *SysLogBo) GetUser() *UserBO

GetUser .

func (*SysLogBo) String

func (l *SysLogBo) String() string

String json string

func (*SysLogBo) ToApiV1

func (l *SysLogBo) ToApiV1() *api.SysLogV1Item

func (*SysLogBo) ToModel

func (l *SysLogBo) ToModel() *do.SysLog

type TestNotifyTemplateParams

type TestNotifyTemplateParams struct {
	NotifyType vobj.NotifyTemplateType `json:"notifyType"`
	Template   string                  `json:"template"`
	StrategyId uint32                  `json:"strategyId"`
}

type UpdateEndpointReq

type UpdateEndpointReq struct {
	Id uint32 `json:"id"`
	*CreateEndpointReq
}

type UserBO

type UserBO struct {
	Id        uint32      `json:"id"`
	Username  string      `json:"username"`
	Nickname  string      `json:"nickname"`
	Password  string      `json:"password"`
	Salt      string      `json:"salt"`
	Email     string      `json:"email"`
	Phone     string      `json:"phone"`
	Status    vobj.Status `json:"status"`
	Remark    string      `json:"remark"`
	Avatar    string      `json:"avatar"`
	CreatedAt int64       `json:"createdAt"`
	UpdatedAt int64       `json:"updatedAt"`
	DeletedAt int64       `json:"deletedAt"`
	Roles     []*RoleBO   `json:"roles"`
	Gender    vobj.Gender `json:"gender"`
}

func UserModelToBO

func UserModelToBO(m *do.SysUser) *UserBO

UserModelToBO .

func (*UserBO) GetRoles

func (l *UserBO) GetRoles() []*RoleBO

GetRoles 获取角色列表

func (*UserBO) String

func (l *UserBO) String() string

String json string

func (*UserBO) ToApiSelectV1

func (l *UserBO) ToApiSelectV1() *api.UserSelectV1

func (*UserBO) ToApiV1

func (l *UserBO) ToApiV1() *api.UserV1

func (*UserBO) ToModel

func (l *UserBO) ToModel() *do.SysUser

Jump to

Keyboard shortcuts

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