tail

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunRelayTail

func RunRelayTail(ctx context.Context)

RunRelayTail runs relay tail

Types

type AuditMsg

type AuditMsg struct {
	Timestamp      string  `json:"ts"`
	XID            xid.ID  `json:"id"`
	StatusCode     int     `json:"sc"`
	UserName       string  `json:"un"`
	OrganizationID string  `json:"o"`
	PartnerID      string  `json:"p"`
	ProjectName    string  `json:"pr"`
	RemoteAddr     string  `json:"ra"`
	Duration       float64 `json:"d"`
	ClusterName    string  `json:"cn"`
	APIVersion     string  `json:"av"`
	Kind           string  `json:"k"`
	Namespace      string  `json:"ns"`
	Name           string  `json:"n"`
	Method         string  `json:"m"`
	URL            string  `json:"url"`
	Query          string  `json:"q"`
	Written        int64   `json:"w"`
	SessionType    string  `json:"st"`
}

AuditMsg represents audit message

func (*AuditMsg) Reset

func (m *AuditMsg) Reset()

Reset resets audit message

type LogMsg

type LogMsg struct {
	//Level      string  `json:"level"`
	//Message    string  `json:"msg"`
	Timestamp  string  `json:"ts"`
	XID        xid.ID  `json:"xid"`
	Method     string  `json:"method"`
	URL        string  `json:"url"`
	Query      string  `json:"query"`
	ServerName string  `json:"serverName"`
	User       string  `json:"user"`
	RemoteAddr string  `json:"remoteAddr"`
	StatusCode int     `json:"statusCode"`
	Written    int64   `json:"written"`
	Duration   float64 `json:"duration"`
}

LogMsg represents log message

type Transformer

type Transformer interface {
	Transform(lm *LogMsg, am *AuditMsg) error
}

Transformer is the interface for transforming relay log message into audit message

func NewTransformer

func NewTransformer(authzPool sentryrpc.SentryAuthorizationPool) (Transformer, error)

NewTransformer returns new relay log transformer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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