model

package
v1.3.32-0...-6d053e1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProxyTokens = make(map[string]int64)

Functions

This section is empty.

Types

type ConfigDatabasesMap

type ConfigDatabasesMap struct {
	Value           string   `json:"value"`
	Name            string   `json:"name"`
	Node            string   `json:"node"`
	Host            string   `json:"host"`
	Primary         bool     `json:"primary"`
	Online          bool     `json:"online"`
	URL             string   `json:"url"`
	ProtectedTables []string `json:"-"`
	SkipTables      []string `json:"-"`
}

type ConfigURLNode

type ConfigURLNode struct {
	Name    string `json:"name"`
	URL     string `json:"url"`
	Primary bool   `json:"primary"`
}

type DataDatabasesMap

type DataDatabasesMap struct {
	Config  *config.ClokiBaseDataBase
	DSN     string `json:"dsn"`
	Session ISqlxDB
}

type Entry

type Entry struct {
	Timestamp time.Time `json:"timestamp"`
	Line      string    `json:"line"`
}

Entry is a log entry with a timestamp.

type GetUser

type GetUser struct {
	// count
	Count int `json:"count"`
	// the data
	Data []*TableUser `json:"data"`
}

swagger:model ListUsers

type HTTPAUTHResp

type HTTPAUTHResp struct {
	Auth bool      `json:"auth" validate:"required"`
	Data TableUser `json:"data" validate:"required"`
}

type IDBRegistry

type IDBRegistry interface {
	GetDB(ctx context.Context) (*DataDatabasesMap, error)
	Run()
	Stop()
	Ping() error
}

type ILabelsGetter

type ILabelsGetter interface {
	Get(fp uint64) labels.Labels
}

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 JSONSpanAttribute struct {
	Key   string `json:"key"`
	Value struct {
		StringValue string `json:"stringValue"`
	} `json:"value"`
}

type JSONSpanEvent

type JSONSpanEvent struct {
	TimeUnixNano uint64 `json:"timeUnixNano"`
	Name         string `json:"name"`
}

type JSONText

type JSONText json.RawMessage

func (JSONText) MarshalJSON

func (j JSONText) MarshalJSON() ([]byte, error)

MarshalJSON returns the *j as the JSON encoding of j.

func (*JSONText) Scan

func (js *JSONText) Scan(value any) error

func (JSONText) String

func (j JSONText) String() string

String supports pretty printing for JSONText types.

func (*JSONText) Unmarshal

func (j *JSONText) Unmarshal(v interface{}) error

Unmarshal unmarshal's the json in j to v, as in json.Unmarshal.

func (*JSONText) UnmarshalJSON

func (j *JSONText) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *j to a copy of data

func (JSONText) Value

func (js JSONText) Value() (driver.Value, error)

type Label

type Label struct {
	Key, Value string
}

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 QueryRangeOutput struct {
	Str string
	Err error
}

type Sample

type Sample struct {
	TimestampMs int64
	Value       float64
}

type SeriesSet

type SeriesSet struct {
	Error  error
	Series []*SeriesV2
	// contains filtered or unexported fields
}

func (*SeriesSet) At

func (e *SeriesSet) At() storage.Series

func (*SeriesSet) Err

func (e *SeriesSet) Err() error

func (*SeriesSet) Next

func (e *SeriesSet) Next() bool

func (*SeriesSet) Reset

func (e *SeriesSet) Reset()

func (*SeriesSet) Warnings

func (e *SeriesSet) Warnings() storage.Warnings

type SeriesV2

type SeriesV2 struct {
	LabelsGetter ILabelsGetter
	Fp           uint64
	Samples      []Sample
	Prolong      bool
	StepMs       int64
}

func (*SeriesV2) Iterator

func (s *SeriesV2) Iterator() chunkenc.Iterator

func (*SeriesV2) Labels

func (s *SeriesV2) Labels() labels.Labels

type ServiceConfig

type ServiceConfig struct {
	Session *sqlx.DB
}

ServiceConfig

type ServiceConfigDatabases

type ServiceConfigDatabases struct {
	Session map[string]*sqlx.DB
}

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 SpanAttr

type SpanAttr struct {
	Key   string `json:"key"`
	Value struct {
		StringValue string `json:"stringValue"`
	} `json:"value"`
}

type SpanInfo

type SpanInfo struct {
	SpanID            string     `json:"spanID"`
	StartTimeUnixNano string     `json:"startTimeUnixNano"`
	DurationNanos     string     `json:"durationNanos"`
	Attributes        []SpanAttr `json:"attributes"`
}

type SpanResponse

type SpanResponse struct {
	Span        *v1.Span
	ServiceName string
}

type SpanSet

type SpanSet struct {
	Spans   []SpanInfo `json:"spans"`
	Matched int        `json:"matched"`
}

type Stream

type Stream struct {
	Labels  string  `json:"labels"`
	Entries []Entry `json:"entries"`
}

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 TSDBStatusMetric struct {
	Name  string `json:"name"`
	Value int32  `json:"value"`
}

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

func (TableUser) TableEngine() string

func (TableUser) TableName

func (TableUser) TableName() string

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 TableUserList struct {
	Data []TableUser `json:"data"`
	// example: 13
	Count int `json:"count"`
}

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 TraceResponse struct {
	TraceID           string `json:"traceID"`
	RootServiceName   string `json:"rootServiceName"`
	RootTraceName     string `json:"rootTraceName"`
	StartTimeUnixNano int64  `json:"startTimeUnixNano"`
	DurationMs        int64  `json:"durationMs"`
}

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

type UserFileDownload struct {
	// in: body
	// swagger:file
	File os.File
}

swagger:model UserFileDownload

type UserFileUpload

type UserFileUpload struct {
	// in: formData
	// swagger:file
	File os.File
}

swagger:model UserFileUpload

type UserGroupList

type UserGroupList struct {
	// example: ["admin","user"]
	Data []string `json:"data"`
	// example: 13
	Count int `json:"count"`
}

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

Jump to

Keyboard shortcuts

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