logservice

package
v0.0.0-...-8910f3d Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	Time      time.Time
	Type      LogType `faker:"oneof: platform.start, platform.report, platform.fault, platform.logsDropped, function"`
	RequestID string
	Content   []byte
}

type LogAPIClient

type LogAPIClient interface {
	SubscribeLogs(ctx context.Context, types []extension.LogType, params extension.SubscribeLogsParams) (res extension.SubscribeResponse, err error)
}

type LogService

type LogService struct {
	// contains filtered or unexported fields
}

func New

func New(params ServiceParams) *LogService

func (*LogService) Run

func (s *LogService) Run(ctx context.Context, wg *sync.WaitGroup)

type LogType

type LogType string
const (
	PlatformStart       LogType = "platform.start"
	PlatformReport      LogType = "platform.report"
	PlatformFault       LogType = "platform.fault"
	PlatformLogsDropped LogType = "platform.logsDropped"
	Function            LogType = "function"
)

type Message

type Message struct {
	Time   time.Time       `json:"time"`
	Type   string          `json:"type"`
	Record json.RawMessage `json:"record"`
}

type ReportRecord

type ReportRecord struct {
	RequestID string          `json:"requestId"`
	Metrics   json.RawMessage `json:"metrics"`
}

type ServiceParams

type ServiceParams struct {
	LogAPIClient         LogAPIClient
	LogTypes             []extension.LogType
	LogsQueue            chan []Log
	ListenPort           int
	MaxItems             int
	MaxBytes             int
	TimeoutMS            int
	EnablePlatformReport bool
}

type StartRecord

type StartRecord struct {
	RequestID string `json:"requestId"`
}

Directories

Path Synopsis
Package automocks is a generated GoMock package.
Package automocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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