wsc

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID_PRIORITY = "invalid_priority"
	D                = "D"
	C                = "C"
	A                = "A"
)
View Source
const (
	MsgId_InternalErr     = 1001
	MsgId_Invalid_Request = 1006
)
View Source
const (
	ErrCode_Internal       = "internal_err"
	ErrCode_InvalidRequest = "invalid_request"
	ErrCode_InvalidJson    = "invalid_json"
	ErrCode_DatabaseError  = "database_error"
	App                    = "app"
)

Variables

View Source
var (
	APP, PRI, DAYS, SEARCHAFTERTIMESTAMP, SEARCHAFTERDOCID, CLASS, INSTANCE string = "App", "Pri", "Days", "SearchAfterTimestamp", "SearchAfterDocId", "Class", "Instance"
	Priority                                                                       = []string{"Debug2", "Debug1", "Debug0", "Info", "Warn", "Err", "Crit", "Sec"}
)
View Source
var (
	DebugPriority = []string{"Debug2", "Debug1", "Debug0", "Info", "Warn", "Err", "Crit", "Sec"}
)

Functions

func GetApps

func GetApps(c *gin.Context, s *service.Service)

func GetDebugLog

func GetDebugLog(c *gin.Context, s *service.Service)

func GetHighprilog

func GetHighprilog(c *gin.Context, s *service.Service)

GetHighprilog : handler for POST: "/highprilog" API

func GetSet

func GetSet(c *gin.Context, s *service.Service)

func GetUnusualIP

func GetUnusualIP(c *gin.Context, s *service.Service)

func ShowActivityLog

func ShowActivityLog(c *gin.Context, s *service.Service)

func ShowDataChange

func ShowDataChange(c *gin.Context, s *service.Service)

ShowDataChange : handler for POST: "/datachangelog" API

Types

type DataChangeReq

type DataChangeReq struct {
	App                  string  `json:"app" validate:"required,alpha,lt=15"`
	Class                *string `json:"class"`
	Instance             *string `json:"instance"`
	Field                *string `json:"field""`
	Days                 *int    `json:"days" validate:"omitempty,gt=0,lt=1003"`
	SearchAfterTimestamp *string `json:"search_after_timestamp" validate:"omitempty,datetime=2006-01-02T15:04:05Z"`
	SearchAfterDocId     *string `json:"search_after_doc_id,omitempty"`
}

DataChangeReq: is for request of ShowDataChange()

type DebugLogRequest

type DebugLogRequest struct {
	App                  string                 `json:"app" validate:"required,alpha,lt=25"`
	Module               string                 `json:"module" validate:"required,alpha"`
	Priority             logharbour.LogPriority `json:"pri" validate:"required"`
	Days                 int                    `json:"days" validate:"required,number"`
	TraceID              *string                `json:"trace_id" validate:"omitempty"`
	SearchAfterTimestamp *string                `json:"search_after_timestamp,omitempty"`
	SearchAfterDocId     *string                `json:"search_after_doc_id,omitempty"`
}

request format

type GetSetReq

type GetSetReq struct {
	App      string                  `json:"app" validate:"required,alpha,lt=50"`
	SetAttr  string                  `json:"setAttr" validate:"required,alpha,lt=50"`
	Type     *logharbour.LogType     `json:"type" validate:"omitempty,oneof=1 2 3 4"`
	Who      *string                 `json:"who" validate:"omitempty,alpha,lt=20"`
	Class    *string                 `json:"class" validate:"omitempty,alpha,lt=30"`
	Instance *string                 `json:"instance" validate:"omitempty,alpha,lt=30"`
	Op       *string                 `json:"op" validate:"omitempty,alpha,lt=25"`
	Fromts   *time.Time              `json:"fromts" validate:"omitempty"`
	Tots     *time.Time              `json:"tots" validate:"omitempty"`
	Ndays    *int                    `json:"ndays" validate:"omitempty,number,lt=100"`
	RemoteIP *string                 `json:"remoteIP" validate:"omitempty"`
	Pri      *logharbour.LogPriority `json:"pri" validate:"omitempty,oneof=1 2 3 4 5 6 7 8"`
}

type GetUnusualIpParam

type GetUnusualIpParam struct {
	App            string  `json:"app" validate:"required,alpha,lt=15"`
	Days           int     `json:"days" validate:"required,number,lt=500"`
	UnusualPercent float64 `json:"unusualPercent"`
}

type HighPriReq

type HighPriReq struct {
	App string                 `json:"app" validate:"required,alpha,lt=15"`
	Pri logharbour.LogPriority `json:"pri" validate:"required,lt=15"`
	// Pri  logharbour.LogPriority `json:"pri" validate:"required, oneof=Info Debug2 Debug1 Debug0 Warn Err Crit Sec"`
	Days                 int     `json:"days" validate:"required,gt=0,lt=1003"`
	SearchAfterTimestamp *string `json:"search_after_timestamp" validate:"omitempty,datetime=2006-01-02T15:04:05Z"`
	SearchAfterDocId     *string `json:"search_after_doc_id,omitempty"`
}

HighPriReq: is for request of GetHighprilog()

type LogRequest

type LogRequest struct {
	App        string                  `json:"app" validate:"required,alpha,lt=15"`
	Who        *string                 `json:"who" validate:"omitempty,alpha,lt=15"`
	Class      *string                 `json:"class" validate:"omitempty,alpha,lt=15"`
	InstanceID *string                 `json:"instance_id" validate:"omitempty,alphanum,lt=15"`
	Op         *string                 `json:"op" validate:"omitempty,alpha,lt=15"`
	Priority   *logharbour.LogPriority `json:"priority" validate:"omitempty,lt=15"`
	Days       int                     `json:"days" validate:"required,number,lt=500"`
	// FromTS               *string                 `json:"fromTs" validate:"omitempty,alpha,lt=15"`
	// ToTS                 *string                 `json:"toTs" validate:"omitempty,alpha,lt=15"`
	SearchAfterTimestamp *string `json:"search_after_timestamp" validate:"omitempty"`
	SearchAfterDocID     *string `json:"search_after_doc_id" validate:"omitempty"`
}

type LogResponse

type LogResponse struct {
	LogEntery []logharbour.LogEntry
	Nrec      int
}

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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