Documentation
¶
Index ¶
- Variables
- type ConfigDatabasesMap
- type ConfigURLNode
- type DataDatabasesMap
- type Entry
- type GetUser
- type HTTPAUTHResp
- type IDBRegistry
- type ILabelsGetter
- type IQueryLabelsService
- type IQueryRangeService
- type ISqlxDB
- type ITempoService
- type IWatcher
- type JSONSpan
- type JSONSpanAttribute
- type JSONSpanEvent
- type JSONText
- type Label
- type LabelRules
- type OAuth2MapToken
- type OAuth2TokenExchange
- type PrometheusMetric
- type PushRequest
- type QueryRangeOutput
- type Sample
- type SeriesSet
- type SeriesV2
- type ServiceConfig
- type ServiceConfigDatabases
- type ServiceData
- type SpanAttr
- type SpanInfo
- type SpanResponse
- type SpanSet
- type Stream
- type TSDBStatus
- type TSDBStatusMetric
- type TableSample
- type TableTimeSeries
- type TableUser
- type TableUserLegacyFormat
- type TableUserList
- type TableUserPasswordUpdate
- type TraceInfo
- type TraceResponse
- type UserCreateSuccessfulResponse
- type UserDeleteSuccessfulResponse
- type UserDetailsResponse
- type UserFileDownload
- type UserFileUpload
- type UserGroupList
- type UserObject
- type UserParameterRequest
- type UserProxyTokenData
- type UserTokenBadResponse
- type UserTokenSuccessfulResponse
- type UserUpdateSuccessfulResponse
- type UserloginDetails
Constants ¶
This section is empty.
Variables ¶
var ProxyTokens = make(map[string]int64)
Functions ¶
This section is empty.
Types ¶
type ConfigDatabasesMap ¶
type ConfigURLNode ¶
type DataDatabasesMap ¶
type DataDatabasesMap struct {
Config *config.ClokiBaseDataBase
DSN string `json:"dsn"`
Session ISqlxDB
}
type GetUser ¶
type GetUser struct {
// count
Count int `json:"count"`
// the data
Data []*TableUser `json:"data"`
}
swagger:model ListUsers
type HTTPAUTHResp ¶
type IDBRegistry ¶
type IDBRegistry interface {
GetDB(ctx context.Context) (*DataDatabasesMap, error)
Run()
Stop()
Ping() error
}
type ILabelsGetter ¶
type IQueryLabelsService ¶
type IQueryLabelsService interface {
Labels(ctx context.Context, startMs int64, endMs int64, labelsType uint16) (chan string, error)
PromValues(ctx context.Context, label string, match []string, startMs int64, endMs int64,
labelsType uint16) (chan string, error)
Prom2LogqlMatch(match string) (string, error)
Values(ctx context.Context, label string, match []string, startMs int64, endMs int64,
labelsType uint16) (chan string, error)
Series(ctx context.Context, requests []string, startMs int64, endMs int64,
labelsType uint16) (chan string, error)
}
type IQueryRangeService ¶
type IQueryRangeService interface {
QueryRange(ctx context.Context, query string, fromNs int64, toNs int64, stepMs int64,
limit int64, forward bool) (chan QueryRangeOutput, error)
QueryInstant(ctx context.Context, query string, timeNs int64, stepMs int64,
limit int64) (chan QueryRangeOutput, error)
Tail(ctx context.Context, query string) (IWatcher, error)
}
type ISqlxDB ¶
type ISqlxDB interface {
GetName() string
/*Query(query string, args ...any) (*sql.Rows, error)*/
QueryCtx(ctx context.Context, query string, args ...any) (*sql.Rows, error)
ExecCtx(ctx context.Context, query string, args ...any) error
Conn(ctx context.Context) (*sql.Conn, error)
Begin() (*sql.Tx, error)
Close()
}
type ITempoService ¶
type ITempoService interface {
Query(ctx context.Context, startNS int64, endNS int64, traceId []byte, binIds bool) (chan *SpanResponse, error)
Tags(ctx context.Context) (chan string, error)
Values(ctx context.Context, tag string) (chan string, error)
ValuesV2(ctx context.Context, key string, query string, from time.Time, to time.Time, limit int) (chan string, error)
Search(ctx context.Context, tags string, minDurationNS int64, maxDurationNS int64,
limit int, fromNS int64, toNS int64) (chan *TraceResponse, error)
SearchTraceQL(ctx context.Context, q string, limit int, from time.Time, to time.Time) (chan []TraceInfo, error)
TagsV2(ctx context.Context, query string, from time.Time, to time.Time, limit int) (chan string, error)
}
type IWatcher ¶
type IWatcher interface {
Close()
GetRes() chan QueryRangeOutput
Done() <-chan struct{}
}
type JSONSpan ¶
type JSONSpan struct {
TraceID string `json:"traceID"`
TraceId string `json:"traceId"`
SpanID string `json:"spanID"`
SpanId string `json:"spanId"`
Name string `json:"name"`
StartTimeUnixNano uint64 `json:"startTimeUnixNano"`
EndTimeUnixNano uint64 `json:"endTimeUnixNano"`
ParentSpanId string `json:"parentSpanId,omitempty"`
ServiceName string `json:"serviceName"`
Attributes []JSONSpanAttribute `json:"attributes"`
Events []JSONSpanEvent `json:"events"`
Status *v1.Status `json:"status,omitempty"`
}
type JSONSpanAttribute ¶
type JSONSpanEvent ¶
type JSONText ¶
type JSONText json.RawMessage
func (JSONText) MarshalJSON ¶
MarshalJSON returns the *j as the JSON encoding of j.
func (*JSONText) UnmarshalJSON ¶
UnmarshalJSON sets *j to a copy of data
type LabelRules ¶
type LabelRules struct {
Label, Cond, Value string
}
type OAuth2MapToken ¶
type OAuth2MapToken struct {
AccessToken string `json:"access_token"`
Provider string `json:"provider"`
DataJson json.RawMessage `json:"datajson"`
CreateDate time.Time `json:"create_date"`
ExpireDate time.Time `json:"expire_date"`
ProfileJson json.RawMessage `json:"profile_json"`
}
swagger:model OAuth2MapToken
type OAuth2TokenExchange ¶
type OAuth2TokenExchange struct {
// example: token
// required: true
OneTimeToken string `json:"token" validate:"required"`
}
swagger:model OAuth2TokenExchange
type PrometheusMetric ¶
type PrometheusMetric struct {
Version uint32 `protobuf:"varint,1,req,name=Version" json:"Version"`
Protocol uint32 `protobuf:"varint,2,req,name=Protocol" json:"Protocol"`
SrcIP string `protobuf:"bytes,3,req,name=SrcIP" json:"SrcIP"`
DstIP string `protobuf:"bytes,4,req,name=DstIP" json:"DstIP"`
SrcPort uint32 `protobuf:"varint,5,req,name=SrcPort" json:"SrcPort"`
DstPort uint32 `protobuf:"varint,6,req,name=DstPort" json:"DstPort"`
Tsec uint32 `protobuf:"varint,7,req,name=Tsec" json:"Tsec"`
Tmsec uint32 `protobuf:"varint,8,req,name=Tmsec" json:"Tmsec"`
ProtoType uint32 `protobuf:"varint,9,req,name=ProtoType" json:"ProtoType"`
NodeID uint32 `protobuf:"varint,10,req,name=NodeID" json:"NodeID"`
NodePW string `protobuf:"bytes,11,req,name=NodePW" json:"NodePW"`
Payload string `protobuf:"bytes,12,req,name=Payload" json:"Payload"`
CID string `protobuf:"bytes,13,req,name=CID" json:"CID"`
Vlan uint32 `protobuf:"varint,14,req,name=Vlan" json:"Vlan"`
ProtoString string
Timestamp time.Time
NodeName string
TargetName string
SID string
}
Data
type PushRequest ¶
type PushRequest struct {
Streams []Stream `json:"streams"`
}
type QueryRangeOutput ¶
type SeriesV2 ¶
type SeriesV2 struct {
LabelsGetter ILabelsGetter
Fp uint64
Samples []Sample
Prolong bool
StepMs int64
}
type ServiceConfigDatabases ¶
ServiceConfigDatabases
type ServiceData ¶
type ServiceData struct {
Session IDBRegistry
}
Service : here you tell us what Salutation is
func (*ServiceData) Ping ¶
func (s *ServiceData) Ping() error
type SpanResponse ¶
type TSDBStatus ¶
type TSDBStatus struct {
TotalSeries int32 `json:"totalSeries"`
TotalLabelValuePairs int32 `json:"totalLabelValuePairs"`
SeriesCountByMetricName []TSDBStatusMetric `json:"seriesCountByMetricName"`
SeriesCountByLabelName []TSDBStatusMetric `json:"seriesCountByLabelName"`
SeriesCountByFocusLabelValue []TSDBStatusMetric `json:"seriesCountByFocusLabelValue"`
SeriesCountByLabelValuePair []TSDBStatusMetric `json:"seriesCountByLabelValuePair"`
LabelValueCountByLabelName []TSDBStatusMetric `json:"labelValueCountByLabelName"`
Quota int32 `json:"quota"`
}
type TSDBStatusMetric ¶
type TableSample ¶
type TableSample struct {
FingerPrint uint64 `db:"fingerprint" clickhouse:"type:UInt64" json:"fingerprint"`
// required: true
TimestampMS int64 `db:"timestamp_ms" clickhouse:"type:Int64" json:"timestamp_ms"`
//
Value float64 `db:"value" clickhouse:"type:Float64" json:"value"`
// example: 10
// required: true
String string `db:"string" clickhouse:"type:String" json:"string"`
}
swagger:model CreateUserStruct
func (TableSample) TableEngine ¶
func (TableSample) TableEngine() string
func (TableSample) TableName ¶
func (TableSample) TableName() string
type TableTimeSeries ¶
type TableTimeSeries struct {
Date time.Time `db:"date" clickhouse:"type:Date" json:"date"`
// required: true
FingerPrint uint64 `db:"fingerprint" clickhouse:"type:UInt64" json:"fingerprint"`
//
Labels string `db:"labels" clickhouse:"type:String" json:"value"`
// example: 10
// required: true
Name string `db:"name" clickhouse:"type:String" json:"string"`
}
func (TableTimeSeries) TableEngine ¶
func (TableTimeSeries) TableEngine() string
func (TableTimeSeries) TableName ¶
func (TableTimeSeries) TableName() string
type TableUser ¶
type TableUser struct {
UUID string `db:"uuid" csv:"-" clickhouse:"type:UUID;default:generateUUIDv4()" json:"guid"`
// required: true
Version uint64 `db:"version" csv:"-" clickhouse:"type:UInt64;default:NOW();key" json:"version" validate:"required,gte=1"`
//
UserName string `db:"username" csv:"username" clickhouse:"type:String;order" json:"username" validate:"required,username"`
// example: 10
// required: true
PartID uint16 `db:"partid" csv:"partid" clickhouse:"type:UInt16;default:10" json:"partid" validate:"required,gte=1"`
// required: true
Email string `db:"email" csv:"email" clickhouse:"type:String" json:"email" validate:"required,email"`
// required: true
Password string `db:"-" csv:"password" json:"password"`
// required: true
FirstName string `db:"firstname" csv:"firstname" clickhouse:"type:String" json:"firstname" validate:"required,min=2,ascii"`
// required: true
LastName string `db:"lastname" csv:"lastname" clickhouse:"type:String" json:"lastname"`
// required: true
// example: NOC
Department string `db:"department" csv:"department" clickhouse:"type:String" json:"department"`
// required: true
// example: admin
UserGroup string `db:"usergroup" csv:"usergroup" clickhouse:"type:String" json:"usergroup" validate:"required,alphanum"`
IsAdmin bool `db:"-" csv:"-" json:"-"`
ExternalAuth bool `db:"-" csv:"-" json:"-"`
ForcePassword bool `db:"-" csv:"-" json:"-"`
Params JSONText `db:"params" csv:"params" clickhouse:"type:String" json:"params"`
Hash string `db:"hash" csv:"passwordhash" clickhouse:"type:String" json:"-"`
// required: true
CreatedAt time.Time `db:"record_datetime" csv:"-" clickhouse:"type:DateTime;default:NOW()" json:"-"`
ExternalProfile string `db:"-" json:"-"`
Avatar string `db:"-" json:"-"`
}
swagger:model CreateUserStruct
func (TableUser) TableEngine ¶
type TableUserLegacyFormat ¶
type TableUserLegacyFormat struct {
UserName string `csv:"username" validate:"alphanum"`
// required: true
PartID uint16 `csv:"partid" validate:"required,gte=1"`
// required: true
Email string `csv:"email" validate:"required,email"`
// required: true
Password string `csv:"password"`
// required: true
FirstName string `csv:"firstname" validate:"required,alphanum"`
// required: true
LastName string `csv:"lastname" validate:"required,alphanum"`
// required: true
// example: NOC
Department string `csv:"department"`
// example: admin
UserGroup string `csv:"usergroup" validate:"required,alphanum"`
//example {}
Params string `csv:"params"`
// example: admin
PasswordHash string `csv:"passwordhash"`
}
swagger:model UserLegacyStruct
type TableUserList ¶
type TableUserPasswordUpdate ¶
type TableUserPasswordUpdate struct {
UUID string `db:"-" csv:"-" json:"guid"`
// required: true
Password string `db:"-" csv:"password" json:"password"`
// required: true
OldPassword string `db:"-" csv:"old_password" json:"old_password"`
}
swagger:model CreateUserStruct
type TraceInfo ¶
type TraceInfo struct {
TraceID string `json:"traceID"`
RootServiceName string `json:"rootServiceName"`
RootTraceName string `json:"rootTraceName"`
StartTimeUnixNano string `json:"startTimeUnixNano"`
DurationMs float64 `json:"durationMs"`
SpanSet SpanSet `json:"spanSet"`
SpanSets []SpanSet `json:"spanSets"`
}
type TraceResponse ¶
type UserCreateSuccessfulResponse ¶
type UserCreateSuccessfulResponse struct {
// data in JSON format
//
// required: true
//
// example: af72057b-2745-0a1b-b674-56586aadec57
Data string `json:"data"`
// the message for user
//
// required: true
// example: successfully created user
Message string `json:"message"`
}
swagger:model UserSuccessResponse
type UserDeleteSuccessfulResponse ¶
type UserDeleteSuccessfulResponse struct {
// example: af72057b-2745-0a1b-b674-56586aadec57
Data string `json:"data"`
// example: successfully deleted user
Message string `json:"message"`
}
swagger:model UserDeleteSuccessResponse
type UserDetailsResponse ¶
type UserDetailsResponse struct {
// the uuid
User struct {
Admin bool `json:"admin"`
Username string `json:"username"`
Usergroup string `json:"usergroup"`
ForcePassword bool `json:"force_password"`
} `json:"user"`
}
swagger:model UserDetailsResponse
type UserFileDownload ¶
swagger:model UserFileDownload
type UserFileUpload ¶
swagger:model UserFileUpload
type UserGroupList ¶
type UserObject ¶
type UserObject struct {
UserName string `json:"username"`
// example: 10
// required: true
PartID uint16 `json:"partid"`
// required: true
UserGroup string `json:"usergroup"`
}
swagger:model CreateUserStruct
type UserParameterRequest ¶
type UserParameterRequest struct {
// in: formData
// swagger:file
File interface{}
}
swagger:parameters UserFileResponse UserFileRequest
type UserProxyTokenData ¶
type UserProxyTokenData struct {
// the token
Token string `json:"token"`
// required: true
ExpireAt time.Time `json:"expire_at"`
}
swagger:model UserLoginSuccessResponse
type UserTokenBadResponse ¶
type UserTokenBadResponse struct {
// statuscode
StatusCode int `json:"statuscode"`
// errot
Error string `json:"error"`
// message
Message string `json:"message"`
}
swagger:model FailureResponse
type UserTokenSuccessfulResponse ¶
type UserTokenSuccessfulResponse struct {
// the token
// example: JWT Token
Token string `json:"token"`
// the uuid
// example: b9f6q23a-0bde-41ce-cd36-da3dbc17ea12
Scope string `json:"scope"`
User struct {
Admin bool `json:"admin"`
ForcePassword bool `json:"force_password"`
} `json:"user"`
}
swagger:model UserLoginSuccessResponse
type UserUpdateSuccessfulResponse ¶
type UserUpdateSuccessfulResponse struct {
// example: af72057b-2745-0a1b-b674-56586aadec57
Data string `json:"data"`
// example: successfully updated user
Message string `json:"message"`
}
swagger:model UserUpdateSuccessResponse
type UserloginDetails ¶
type UserloginDetails struct {
// example: admin
// required: true
Username string `json:"username" validate:"required"`
// example: sipcapture
// required: true
Password string `json:"password" validate:"required"`
// the type of the auth one would like to perform, internal/ldap
// example: internal
// required: false
Type string `json:"type" validate:"-"`
}
swagger:model UserLogin