server

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Overview

Package server implements the gRPC server of the audit log agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLogAgent

type AuditLogAgent struct {
	api.UnimplementedAuditLogAgentServer
	// contains filtered or unexported fields
}

AuditLogAgent is the implementation of the audit log agent server.

func NewAuditLogAgent

func NewAuditLogAgent(client *audit.Client) (*AuditLogAgent, error)

NewAuditLogAgent creates a new AuditLogAgent.

func (*AuditLogAgent) ProcessLog

func (a *AuditLogAgent) ProcessLog(ctx context.Context, logReq *api.AuditLogRequest) (*api.AuditLogResponse, error)

ProcessLog processes the log requests by calling the internal client.

type Config

type Config struct {
	Port string `env:"PORT, default=8080"`

	// If trace ratio is >= 1 will trace all requests.
	// If trace ratio <= 0 will not trace at all.
	TraceRatio float64 `env:"TRACE_RATIO, default=0.001"`
}

Config includes all server configs.

func NewConfig

func NewConfig(ctx context.Context) (*Config, error)

NewConfig initializes a server config from environment vars.

Jump to

Keyboard shortcuts

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