klog

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: BSD-2-Clause Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxKeyCount     = 900     // amount
	MaxKeySize      = 1 << 20 // byte
	MaxValueSize    = 1 << 20 // byte
	MaxBulkSize     = 4 << 10 // amount
	MaxLogSize      = 3000000 // byte
	MaxLogGroupSize = 3000000 // byte
)
View Source
const (
	InternalServerError              = "InternalServerError"
	SignatureNotMatch                = "SignatureNotMatch"
	PostBodyTooLarge                 = "PostBodyTooLarge"
	PostBodyInvalid                  = "PostBodyInvalid" // deprecated
	ProjectOrLogPoolNotExist         = "ProjectOrLogPoolNotExist"
	UserNotExist                     = "UserNotExist"
	MaxBulkSizeExceeded              = "MaxBulkSizeExceeded"
	MaxKeyCountExceeded              = "MaxKeyCountExceeded"
	MaxKeySizeExceeded               = "MaxKeySizeExceeded"
	MaxValueSizeExceeded             = "MaxValueSizeExceeded"
	MaxLogSizeExceeded               = "MaxLogSizeExceeded"
	InvalidUtf8InKey                 = "InvalidUtf8InKey"
	InvalidUtf8InValue               = "InvalidUtf8InValue"
	HttpError                        = "HttpError"
	SignatureError                   = "SignatureError"
	CompressLz4Error                 = "CompressLz4Error"
	UnknownError                     = "UnknownError"
	RequestOpenAPIBodyOrParamInvalid = "RequestOpenAPIBodyOrParamInvalid"
	InvalidRequest                   = "InvalidRequest"
	JsonMarshalError                 = "JsonMarshalError"
	JsonUnMarshalError               = "JsonUnMarshalError"
)

错误码

View Source
const (
	HeaderRequestId            = "X-KSC-REQUEST-ID"
	OpenAPIVersion             = "2020-07-31"
	SDKInternalErrorStatusCode = -1
)
View Source
const (
	MINIMAL_RATE float64 = 1e-8
	MAX_COUNT    float64 = 1 << 30
)
View Source
const (
	LevelDebug int = 1
	LevelInfo  int = 2
	LevelWarn  int = 3
	LevelError int = 4
)
View Source
const (
	CompressMethodNone = "none"
	CompressMethodLz4  = "lz4"
)
View Source
const (
	SDKVersion = "0.5.1-go-gitee"
)

Variables

View Source
var BeijingZone = time.FixedZone("beijing", 3600*8)
View Source
var DefaultChainCredentials = credentials.NewChainCredentials(
	[]credentials.Provider{
		&credentials.EnvProvider{},
		&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
	})

DefaultChainCredentials is a Credentials which will find the first available credentials Value from the list of Providers.

This should be used in the default case. Once the type of credentials are known switching to the specific Credentials will be more efficient.

Functions

func IsError

func IsError(err error, code string) bool

Types

type AlarmLogPolicyStatusReq

type AlarmLogPolicyStatusReq struct {
	PolicyId int64 `json:"policyId"`
	Enabled  int   `json:"enabled"`
}

func NewAlarmLogPolicyStatusReq

func NewAlarmLogPolicyStatusReq(enabled bool, policyId int64) *AlarmLogPolicyStatusReq

type AlarmStatisticReq

type AlarmStatisticReq struct {
	PolicyId int64 `json:"policyId"`
	Start    int64 `json:"start"`
	End      int64 `json:"end"`
}

func (*AlarmStatisticReq) ConvertToMap

func (o *AlarmStatisticReq) ConvertToMap() map[string]interface{}

type ChartIdInfo

type ChartIdInfo struct {
	ChartId *int64
}

type ChartIdResp

type ChartIdResp struct {
	ErrorResp
	ChartIdInfo
}

type ChartInfo

type ChartInfo struct {
	DashboardId *int64           `json:"DashboardId"`
	ChartName   string           `json:"ChartName"`
	ChartType   string           `json:"ChartType"`
	Search      *ChartSearchInfo `json:"Search"`
	CreateTime  string           `json:"CreateTime"`
	UpdateTime  string           `json:"UpdateTime"`
	Display     string           `json:"Display"`
}

type ChartSearchInfo

type ChartSearchInfo struct {
	LogPoolName string `json:"LogPoolName"`
	TimeRange   string `json:"TimeRange"`
	Query       string `json:"Query"`
}

type Client

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

func NewClient

func NewClient(options *ClientOptions) *Client

func (Client) CreateChart

func (o Client) CreateChart(req *ChartInfo) (*ChartIdResp, error)

func (Client) CreateDashboard

func (o Client) CreateDashboard(req *DashboardInfo) (*DashboardIdResp, error)

func (Client) CreateDownloadTask

func (o Client) CreateDownloadTask(req *DownloadTaskReq) (*ErrorResp, error)

func (Client) CreateLogPolicy

func (o Client) CreateLogPolicy(req *LogPolicyInfo) (*LogPolicyResp, error)

func (Client) CreateLogPool

func (o Client) CreateLogPool(req *LogPoolInfo) (*ErrorResp, error)

func (Client) CreateProject

func (o Client) CreateProject(req *ProjectInfo) (*ErrorResp, error)

func (Client) CreateUser

func (o Client) CreateUser() (*ErrorResp, error)

func (Client) DeleteChart

func (o Client) DeleteChart(req *ChartInfo) (*ErrorResp, error)

func (Client) DeleteDashboard

func (o Client) DeleteDashboard(req *DeleteDashboardReq) (*ErrorResp, error)

func (Client) DeleteLogPool

func (o Client) DeleteLogPool(req *LogPoolInfo) (*ErrorResp, error)

func (Client) DeleteProject

func (o Client) DeleteProject(req *ProjectInfo) (*ErrorResp, error)

func (Client) DescribeAlertStatistics

func (o Client) DescribeAlertStatistics(req *AlarmStatisticReq) (*LogPolicyResp, error)

func (Client) DescribeDashboard

func (o Client) DescribeDashboard(req *DescribeDashboardReq) (*DescribeDashboardResp, error)

func (Client) DescribeLogHistory

func (o Client) DescribeLogHistory(req *DescribeLogHistoryReq) (*LogPolicyResp, error)

func (Client) DescribeLogPolicy

func (o Client) DescribeLogPolicy(req *DescribeLogPolicyReq) (*LogPolicyResp, error)

func (Client) DescribeLogPool

func (o Client) DescribeLogPool(req *NameInfo) (*DescribeLogPoolResp, error)

func (Client) DescribeProjectInfo

func (o Client) DescribeProjectInfo(req *NameInfo) (*DescribeProjectResp, error)

func (Client) EnableDisableLogPolicy

func (o Client) EnableDisableLogPolicy(req *AlarmLogPolicyStatusReq) (*LogPolicyResp, error)

func (*Client) Flush

func (o *Client) Flush(wait bool)

Flush 在程序结束的时候,需要调用一次该函数 wait 是否等待发送完毕

func (Client) GetDataHeat

func (o Client) GetDataHeat(req *DataHeatReq) (*DataHeatResp, error)

func (Client) GetDownloadUrls

func (o Client) GetDownloadUrls(req *DownloadUrlReq) (*DownloadUrlsResp, error)

func (Client) GetDynamicIndex

func (o Client) GetDynamicIndex(req *NameInfo) (*IndexTemplateResp, error)

func (Client) GetIndexTemplate

func (o Client) GetIndexTemplate(req *NameInfo) (*IndexTemplateResp, error)

func (Client) GetLogs

func (o Client) GetLogs(req *LogInfoReq) (*LogInfoResp, error)

func (Client) GetMonitorData

func (o Client) GetMonitorData(req *MonitorDataReq) (*MonitorDataResp, error)

func (*Client) GetStat

func (o *Client) GetStat() *Stat

func (*Client) GetStatDelta

func (o *Client) GetStatDelta() *Stat

func (Client) GetToken

func (o Client) GetToken(expireTime int64) (*GetTokenResp, error)

func (Client) GetTokenDefaultExpiration

func (o Client) GetTokenDefaultExpiration() (*GetTokenResp, error)

func (Client) GetUsage

func (o Client) GetUsage(req *GetUsageReq) (*GetUsageResp, error)

func (Client) GetUsageFee

func (o Client) GetUsageFee(req *GetUsageFeeReq) (*GetUsageFeeResp, error)

func (Client) GetUserGroup

func (o Client) GetUserGroup() (*UserGroupResp, error)

func (Client) GetUserStatus

func (o Client) GetUserStatus() (*UserInfoResp, error)

func (Client) ListDashboards

func (o Client) ListDashboards(req *ListDashboardsReq) (*ListDashboardResp, error)

func (Client) ListDownloadTasks

func (o Client) ListDownloadTasks(req *ListDownloadTaskReq) (*ListDownloadTaskResp, error)

func (Client) ListIamProjects

func (o Client) ListIamProjects() (*ListIamProjectsResp, error)

func (Client) ListLogPools

func (o Client) ListLogPools(req *ListLogPoolReq) (*ListLogPoolResp, error)

func (Client) ListProjects

func (o Client) ListProjects(req *ListProjectReq) (*ListProjectResp, error)

func (Client) ListTagKeys

func (o Client) ListTagKeys() (*ListTagKeyResp, error)

func (Client) ListTagValues

func (o Client) ListTagValues(req *TagInfo) (*ListTagValuesResp, error)

func (Client) ModifyLogPolicy

func (o Client) ModifyLogPolicy(req *LogPolicyInfo) (*LogPolicyResp, error)

func (*Client) Push

func (o *Client) Push(projectName, logPoolName, source, filename string, log *Log) error

Push 异步发送一条log 如果返回error,表示日志大小、编码等不符合要求 source: 日志来源,如主机名、ip等,用于进行日志上下文查询 filename: 日志文件路径,用于进行日志上下文查询

func (*Client) PushString

func (o *Client) PushString(projectName, logPoolName, message, source, filename string, timestamp int64) error

PushString 是 Push 的一个便利用法。

func (Client) RemoveLogPolicy

func (o Client) RemoveLogPolicy(req *RemoveLogPolicyReq) (*LogPolicyResp, error)

func (Client) SetIndexTemplate

func (o Client) SetIndexTemplate(req *IndexTemplateReq) (*ErrorResp, error)

func (*Client) Stop

func (o *Client) Stop()

Stop 用于程序退出

func (Client) UpdateChart

func (o Client) UpdateChart(req *ChartInfo) (*ErrorResp, error)

func (Client) UpdateDashboard

func (o Client) UpdateDashboard(req *UpdateDashboardReq) (*ErrorResp, error)

func (Client) UpdateDashboardName

func (o Client) UpdateDashboardName(req *UpdateDashboardReq) (*ErrorResp, error)

func (Client) UpdateLogPool

func (o Client) UpdateLogPool(req *LogPoolInfo) (*ErrorResp, error)

func (Client) UpdateProject

func (o Client) UpdateProject(req *ProjectInfo) (*ErrorResp, error)

type ClientOptions

type ClientOptions struct {
	AccessKey   string
	SecretKey   string
	Credentials *credentials.Credentials
	Endpoint    string
	HTTPClient  *http.Client
	Logger      Logger
	LogLevel    int

	// 发送日志的协程数
	WorkerNum           int
	CompressMethod      string
	DropIfPoolNotExists bool
	RateLimit           int
	DownSampleRate      float64
	MaxRetries          int

	// 标识上报的app名字,非必填
	AppName string

	// 机器ID,取值范围[1, 1023],用于生成日志ID。如果缺省,会随机生成一个机器ID。
	MachineId int
}

type DashboardIdResp

type DashboardIdResp struct {
	ErrorResp
	DashboardId *int64
}

type DashboardInfo

type DashboardInfo struct {
	DashboardId   int64
	DashboardName string
	ProjectName   string
	Charts        []*ChartInfo
	CreateTime    string
	UpdateTime    string
}

type DataHeatItemMetric

type DataHeatItemMetric struct {
	Name    string
	Value   string
	Percent string
}

type DataHeatMetricInfo

type DataHeatMetricInfo struct {
	MetricName string
	ItemType   string
	Metrics    []*DataHeatItemMetric
}

type DataHeatReq

type DataHeatReq struct {
	ProjectNames []string
	LogPoolNames []string
}

type DataHeatResp

type DataHeatResp struct {
	ErrorResp
	ProjectNames []string
	LogPoolNames []string
	HeatMetrics  []*DataHeatMetricInfo
}

type DeleteDashboardReq

type DeleteDashboardReq struct {
	DashboardId *int64
}

type DescribeDashboardReq

type DescribeDashboardReq struct {
	DashboardId *int64
}

type DescribeDashboardResp

type DescribeDashboardResp struct {
	ErrorResp
	DashboardInfo
}

type DescribeLogHistoryReq

type DescribeLogHistoryReq struct {
	LogPolicyPageInfo
	Idc         string `json:"idc"`
	PolicyId    int64  `json:"policyId"`
	Start       int64  `json:"start"`
	End         int64  `json:"end"`
	Query       string `json:"query"`
	ProjectName string `json:"projectName"`
}

func (*DescribeLogHistoryReq) ConvertToMap

func (o *DescribeLogHistoryReq) ConvertToMap() map[string]interface{}

type DescribeLogPolicyReq

type DescribeLogPolicyReq struct {
	LogPolicyPageInfo
	Query       string `json:"query"`
	Enabled     int    `json:"enabled"`
	ProjectName string `json:"projectName"`
	DashboardId int64  `json:"dashboardId"`
}

func (*DescribeLogPolicyReq) ConvertToMap

func (o *DescribeLogPolicyReq) ConvertToMap() map[string]interface{}

func (*DescribeLogPolicyReq) ValidateReq

func (o *DescribeLogPolicyReq) ValidateReq() error

type DescribeLogPoolReq

type DescribeLogPoolReq struct {
	NameInfo
}

func (*DescribeLogPoolReq) ValidateReq

func (o *DescribeLogPoolReq) ValidateReq() error

type DescribeLogPoolResp

type DescribeLogPoolResp struct {
	ErrorResp
	LogPoolInfo
}

type DescribeProjectReq

type DescribeProjectReq struct {
	ProjectName string
}

func (*DescribeProjectReq) ValidateReq

func (o *DescribeProjectReq) ValidateReq() error

type DescribeProjectResp

type DescribeProjectResp struct {
	ErrorResp
	ProjectInfo
}

type DownSampler

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

func NewDownSampler

func NewDownSampler(rate float64) *DownSampler

func (*DownSampler) Ok

func (o *DownSampler) Ok() bool

type DownloadTask

type DownloadTask struct {
	NameInfo
	TimeRangeInfo
	DownloadID string
	StartTime  int64
	EndTime    int64
}

type DownloadTaskReq

type DownloadTaskReq struct {
	NameInfo
	TimeRangeInfo
}

func (*DownloadTaskReq) ValidateReq

func (o *DownloadTaskReq) ValidateReq() error

type DownloadUrlInfo

type DownloadUrlInfo struct {
	TimeRangeInfo
	Url      string
	FileName string
	Status   string
	Size     float64
	SizeUnit string
}

type DownloadUrlReq

type DownloadUrlReq struct {
	DownloadTask
}

type DownloadUrlsResp

type DownloadUrlsResp struct {
	ErrorResp
	Urls []*DownloadUrlInfo
}

type ErrorResp

type ErrorResp struct {
	ErrorCode    string `json:"ErrorCode,omitempty"`
	ErrorMessage string `json:"ErrorMessage,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorResp) GetErrorResp

func (o *ErrorResp) GetErrorResp() ErrorResp

func (ErrorResp) GetRequestId

func (o ErrorResp) GetRequestId() string

func (ErrorResp) GetStatusCode

func (o ErrorResp) GetStatusCode() int

func (*ErrorResp) HasError

func (o *ErrorResp) HasError() bool

func (*ErrorResp) SetErrorResp

func (o *ErrorResp) SetErrorResp(resp ErrorResp)

func (*ErrorResp) SetRequestId

func (o *ErrorResp) SetRequestId(requestId string)

func (*ErrorResp) SetStatusCode

func (o *ErrorResp) SetStatusCode(statusCode int)

type FullTextIndex

type FullTextIndex struct {
	Chinese   bool
	Lowercase bool
	Separator string
}

type GetTokenResp

type GetTokenResp struct {
	ErrorResp
	Token    string
	ExpireAt int64
}

type GetUsageFeeReq

type GetUsageFeeReq struct {
	From    string      `json:"From,omitempty"`
	To      string      `json:"To,omitempty"`
	Targets []*NameInfo `json:"Targets,omitempty"`
	Metrics []string    `json:"Metrics,omitempty"`
}

func (*GetUsageFeeReq) ValidateReq

func (o *GetUsageFeeReq) ValidateReq() error

type GetUsageFeeResp

type GetUsageFeeResp struct {
	ErrorResp
	SumPrice float64
	Data     []*UsageMetricInfo
}

type GetUsageReq

type GetUsageReq struct {
	Projects   []string
	TimeSeries []int64
	Data       []*UsageMetricInfo
}

type GetUsageResp

type GetUsageResp struct {
	ErrorResp
	Projects   []string
	TimeSeries []int64
	Data       []*UsageMetricInfo
}

type IKLogError

type IKLogError interface {
	SetErrorResp(ErrorResp)
	GetErrorResp() ErrorResp
}

type IamProjectInfo

type IamProjectInfo struct {
	ProjectId   int64
	ProjectName string
	ProjectDesc string
	Status      int
	CreateTime  string
	Krn         string
}

type IndexField

type IndexField struct {
	FullTextIndex
	FieldName  string
	FieldType  string
	FieldAlias string
	SubFields  []*IndexField
}

type IndexTemplateReq

type IndexTemplateReq struct {
	NameInfo
	FullTextIndex *FullTextIndex
	IndexFields   []*IndexField
	IndexStatus   bool
}

func NewIndexTemplateReq

func NewIndexTemplateReq(projectName, logPoolName string, fullTextIndex *FullTextIndex, indexStatus bool) *IndexTemplateReq

func (*IndexTemplateReq) ValidateReq

func (o *IndexTemplateReq) ValidateReq() error

type IndexTemplateResp

type IndexTemplateResp struct {
	ErrorResp
	NameInfo
	FullTextIndex *FullTextIndex
	IndexFields   []*IndexField
	IndexStatus   bool
}

type ListDashboardResp

type ListDashboardResp struct {
	ErrorResp
	ListRespInfo
	Dashboards []*DashboardInfo
}

type ListDashboardsReq

type ListDashboardsReq struct {
	PageInfo
	DashboardInfo
}

func (*ListDashboardsReq) ValidateReq

func (o *ListDashboardsReq) ValidateReq() error

type ListDownloadTaskReq

type ListDownloadTaskReq struct {
	PageInfo
	NameInfo
}

func (*ListDownloadTaskReq) ValidateReq

func (o *ListDownloadTaskReq) ValidateReq() error

type ListDownloadTaskResp

type ListDownloadTaskResp struct {
	ErrorResp
	ListRespInfo
	Downloads []*DownloadTask
}

type ListIamProjectsResp

type ListIamProjectsResp struct {
	ErrorResp
	Total       int64
	ProjectList []*IamProjectInfo
}

type ListLogPoolReq

type ListLogPoolReq struct {
	PageInfo
	NameInfo
	Tags []*TagInfo
}

func (*ListLogPoolReq) ValidateReq

func (o *ListLogPoolReq) ValidateReq() error

type ListLogPoolResp

type ListLogPoolResp struct {
	ErrorResp
	NameInfo
	ListRespInfo
	LogPools []*LogPoolInfo
}

type ListProjectReq

type ListProjectReq struct {
	PageInfo
	ProjectName string
	Tags        []*TagInfo
	Region      string
}

func NewListProjectReq

func NewListProjectReq(page, size int) *ListProjectReq

func (*ListProjectReq) ValidateReq

func (o *ListProjectReq) ValidateReq() error

type ListProjectResp

type ListProjectResp struct {
	ErrorResp
	ListRespInfo
	Projects []*ProjectInfo
}

type ListRespInfo

type ListRespInfo struct {
	Total int64
	Count int64
}

type ListTagKeyResp

type ListTagKeyResp struct {
	ErrorResp
	ListRespInfo
	Keys []string
}

type ListTagValuesResp

type ListTagValuesResp struct {
	ErrorResp
	ListRespInfo
	Tags []*TagInfo
}

type Log

type Log struct {
	Time     int64          `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
	Contents []*Log_Content `protobuf:"bytes,2,rep,name=contents,proto3" json:"contents,omitempty"`
	// contains filtered or unexported fields
}

func (*Log) Descriptor deprecated

func (*Log) Descriptor() ([]byte, []int)

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) GetContents

func (x *Log) GetContents() []*Log_Content

func (*Log) GetTime

func (x *Log) GetTime() int64

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) ProtoReflect

func (x *Log) ProtoReflect() protoreflect.Message

func (*Log) Reset

func (x *Log) Reset()

func (*Log) String

func (x *Log) String() string

type LogGroup

type LogGroup struct {
	Logs     []*Log  `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
	Reserved *string `protobuf:"bytes,2,opt,name=reserved,proto3,oneof" json:"reserved,omitempty"`
	Filename *string `protobuf:"bytes,3,opt,name=filename,proto3,oneof" json:"filename,omitempty"`
	Source   *string `protobuf:"bytes,4,opt,name=source,proto3,oneof" json:"source,omitempty"`
	Project  *string `protobuf:"bytes,5,opt,name=project,proto3,oneof" json:"project,omitempty"`
	Pool     *string `protobuf:"bytes,6,opt,name=pool,proto3,oneof" json:"pool,omitempty"`
	// contains filtered or unexported fields
}

func (*LogGroup) Descriptor deprecated

func (*LogGroup) Descriptor() ([]byte, []int)

Deprecated: Use LogGroup.ProtoReflect.Descriptor instead.

func (*LogGroup) GetFilename

func (x *LogGroup) GetFilename() string

func (*LogGroup) GetLogs

func (x *LogGroup) GetLogs() []*Log

func (*LogGroup) GetPool

func (x *LogGroup) GetPool() string

func (*LogGroup) GetProject

func (x *LogGroup) GetProject() string

func (*LogGroup) GetReserved

func (x *LogGroup) GetReserved() string

func (*LogGroup) GetSource

func (x *LogGroup) GetSource() string

func (*LogGroup) ProtoMessage

func (*LogGroup) ProtoMessage()

func (*LogGroup) ProtoReflect

func (x *LogGroup) ProtoReflect() protoreflect.Message

func (*LogGroup) Reset

func (x *LogGroup) Reset()

func (*LogGroup) String

func (x *LogGroup) String() string

type LogGroupList

type LogGroupList struct {
	LogGroupList []*LogGroup `protobuf:"bytes,1,rep,name=logGroupList,proto3" json:"logGroupList,omitempty"`
	// contains filtered or unexported fields
}

func (*LogGroupList) Descriptor deprecated

func (*LogGroupList) Descriptor() ([]byte, []int)

Deprecated: Use LogGroupList.ProtoReflect.Descriptor instead.

func (*LogGroupList) GetLogGroupList

func (x *LogGroupList) GetLogGroupList() []*LogGroup

func (*LogGroupList) ProtoMessage

func (*LogGroupList) ProtoMessage()

func (*LogGroupList) ProtoReflect

func (x *LogGroupList) ProtoReflect() protoreflect.Message

func (*LogGroupList) Reset

func (x *LogGroupList) Reset()

func (*LogGroupList) String

func (x *LogGroupList) String() string

type LogHistogram

type LogHistogram struct {
	Key      string
	LogCount int64
}

type LogHistory

type LogHistory struct {
	Id            float64 `json:"id"`
	PolicyId      float64 `json:"policyId"`
	ProjectName   string  `json:"projectName"`
	LogPoolName   string  `json:"logPoolName"`
	DashboardId   string  `json:"dashboardId" `
	DashboardName string  `json:"dashboardName"`
	Name          string  `json:"alertName" `
	ExecuteTime   float64 `json:"executeTime" `
	Condition     string  `json:"condition" `
	NotifyStatus  string  `json:"notifyStatus"`
	Status        string  `json:"status" `
	IsTrigger     bool    `json:"isTrigger"`
	Reason        string  `json:"reason"`
	CreateTime    float64 `json:"createtime"`
}

type LogInfoReq

type LogInfoReq struct {
	NameInfo
	TimeRangeInfo
	Query        string
	HitsOpen     bool
	Interval     int64
	Offset       int
	Size         int
	SortBy       []map[string]bool
	Aggregations interface{}
}

func NewLogInfoReq

func NewLogInfoReq(projectName string, logPoolName string, from int64, to int64, query string) *LogInfoReq

func (*LogInfoReq) ValidateReq

func (o *LogInfoReq) ValidateReq() error

type LogInfoResp

type LogInfoResp struct {
	ErrorResp
	Total        int64
	Count        int64
	HasSql       bool
	Logs         []map[string]interface{}
	Keys         []string
	Histogram    []*LogHistogram
	KeyValues    map[string][]interface{}
	Aggregations map[string]interface{}
}

type LogPolicyChannelParam

type LogPolicyChannelParam struct {
	UsrgrpId     float64 `json:"usrgrpId"`
	UsrgrpName   string  `json:"usrgrpName"`
	ChannelType  float64 `json:"channelType"`
	CallBackUrl  string  `json:"callbackUrl"`
	SmsContent   string  `json:"smsContent"`
	EmailContent string  `json:"emailContent"`
}

type LogPolicyInfo

type LogPolicyInfo struct {
	Id              int64                  `json:"id"`
	Name            string                 `json:"name"`
	ProjectName     string                 `json:"projectName"`
	DashboardId     string                 `json:"dashboardId"`
	DashBoardName   string                 `json:"dashBoardName"`
	Queries         []*LogQuery            `json:"queries"`
	ChannelParam    *LogPolicyChannelParam `json:"channelParam"`
	ChannelParams   string                 `json:"channelParams"`
	Condition       string                 `json:"condition"`
	ScheduleType    int64                  `json:"scheduleType"`
	FixInterval     string                 `json:"fixInterval"`
	DayOfWeek       int                    `json:"dayOfWeek"`
	Hour            int                    `json:"hour"`
	CronExpr        string                 `json:"cronExpr"`
	NotifyThreshold int64                  `json:"notifyThreshold"`
	NotifyInterval  int64                  `json:"notifyInterval"`
	Remarks         string                 `json:"remarks"`
	Status          *bool                  `json:"-"`
	Enabled         int                    `json:"enabled"`
	Idc             string                 `json:"idc"`
}

func (*LogPolicyInfo) ValidateReq

func (o *LogPolicyInfo) ValidateReq() error

type LogPolicyPageInfo

type LogPolicyPageInfo struct {
	PageIndex int64 `json:"pageIndex,omitempty"`
	PageSize  int64 `json:"pageSize,omitempty"`
}

type LogPolicyResp

type LogPolicyResp struct {
	ErrorResp
	Status     int         `json:"status"`
	Message    string      `json:"message"`
	TotalCount int         `json:"totalCount"`
	Data       interface{} `json:"data"`
}

type LogPoolInfo

type LogPoolInfo struct {
	NameInfo
	Tags          []*TagInfo
	Partitions    int
	RetentionDays int
	LogPoolId     string
	Description   string
	CreateTime    string
	UpdateTime    string
}

func NewLogPoolInfo

func NewLogPoolInfo(projectName, logPoolName string, partitions, retentionDays int) *LogPoolInfo

type LogQuery

type LogQuery struct {
	Id           float64 `json:"id"`
	PolicyId     float64 `json:"policyId" `
	GraphId      float64 `json:"graphId" `
	GraphName    string  `json:"graphName" `
	Query        string  `json:"query" `
	Start        string  `json:"start"`
	End          string  `json:"end"`
	LogPoolName  string  `json:"logPoolName"`
	TimeSpanType string  `json:"timeSpanType"`
}

type LogStatistics

type LogStatistics struct {
	AlarmCount  int64  `json:"alarmCount"`
	NotifyCount int64  `json:"notifyCount"`
	AlarmDod    string `json:"alarmDod"`
	NofityDod   string `json:"notifyDod"`
}

type Log_Content

type Log_Content struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Log_Content) Descriptor deprecated

func (*Log_Content) Descriptor() ([]byte, []int)

Deprecated: Use Log_Content.ProtoReflect.Descriptor instead.

func (*Log_Content) GetKey

func (x *Log_Content) GetKey() string

func (*Log_Content) GetValue

func (x *Log_Content) GetValue() string

func (*Log_Content) ProtoMessage

func (*Log_Content) ProtoMessage()

func (*Log_Content) ProtoReflect

func (x *Log_Content) ProtoReflect() protoreflect.Message

func (*Log_Content) Reset

func (x *Log_Content) Reset()

func (*Log_Content) String

func (x *Log_Content) String() string

type Logger

type Logger interface {
	Debugf(format string, a ...interface{})
	Infof(format string, a ...interface{})
	Warnf(format string, a ...interface{})
	Errorf(format string, a ...interface{})
}

func GetStdLogger

func GetStdLogger(level int) Logger

GetStdLogger 获取 logger 单例

type MonitorDataKeyValue

type MonitorDataKeyValue struct {
	LogPool string
	Project string
}

type MonitorDataPoint

type MonitorDataPoint struct {
	Keys   *MonitorDataKeyValue
	Values [][]int
}

type MonitorDataPoints

type MonitorDataPoints struct {
	MetricName string
	Points     []*MonitorDataPoint
}

type MonitorDataReq

type MonitorDataReq struct {
	Service     string
	ProjectName string
	MetricNames []string
	Period      int
	LogPools    []string
	StartTime   string
	EndTime     string
	PageSize    int
	PageNumber  int
}

type MonitorDataResp

type MonitorDataResp struct {
	ErrorResp
	TotalCount int
	PageSize   int
	PageNumber int
	DataPoints []*MonitorDataPoints
}

type NameInfo

type NameInfo struct {
	ProjectName string `json:"ProjectName,omitempty"`
	LogPoolName string `json:"LogPoolName,omitempty"`
}

type PageInfo

type PageInfo struct {
	Page int
	Size int
}

type ProjectInfo

type ProjectInfo struct {
	ProjectName    string
	IamProjectId   int64
	IamProjectName string
	Region         string
	CreateTime     string
	UpdateTime     string
	Description    string
	Tags           []*TagInfo
	LogPoolNum     int
	Status         string
}

type RateLimit

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

func NewRateLimit

func NewRateLimit(limitPerSec, slotsPerSec int) *RateLimit

func (*RateLimit) Wait

func (o *RateLimit) Wait()

type RemoveLogPolicyReq

type RemoveLogPolicyReq struct {
	PolicyIdList []int64 `json:"policyIdList"`
}

type SpecialMetricInfo

type SpecialMetricInfo struct {
	Code  string
	Value int64
}

type Stat

type Stat struct {
	CurRetried      int64
	DownSampledLogs int64 // 被降采样丢弃的日志数
	DroppedLogs     int64 // 因日志池不存在,被丢弃的日志数
	ErroredLogs     int64 // 单条超限或编码错误,被丢弃的日志数
	FailedBatches   int64
	FailedLogs      int64 // 达到最大重试次数之后,被丢弃的日志数
	LastError       string
	LastLogs        int64
	LastRetried     int64
	LastRetriedAt   string
	LastSucceededAt string
	Retried         int64
	SentBatches     int64
	SentLogs        int64 // 发送成功的日志数
	StartedAt       string
	// contains filtered or unexported fields
}

type TagInfo

type TagInfo struct {
	Id    int64
	Key   string
	Value string
}

type TimeRangeInfo

type TimeRangeInfo struct {
	From int64
	To   int64
}

type UpdateDashboardReq

type UpdateDashboardReq struct {
	DashboardId   *int64
	DashboardName string
	ProjectName   string
	Charts        []*ChartInfo
}

func (*UpdateDashboardReq) ValidateReq

func (o *UpdateDashboardReq) ValidateReq() error

type UsageMetricInfo

type UsageMetricInfo struct {
	MetricName     string
	YesterdayUsage int64
	DayToDayRatio  string
	Output         []int64
	Unit           string
	Price          float64
	SpecialMetric  []*SpecialMetricInfo
}

type UserGroupResp

type UserGroupResp struct {
	ErrorResp
	UserGrpList []*UserGrpList `json:"userGrpList"`
	TotalCount  int            `json:"totalCount"`
}

type UserGrpList

type UserGrpList struct {
	UsrGrpID  int    `json:"usrGrpId"`
	Name      string `json:"name"`
	UserCount int    `json:"userCount"`
}

type UserInfoResp

type UserInfoResp struct {
	ErrorResp
	UserId     string
	UserStatus int
}

Jump to

Keyboard shortcuts

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