report

package
v0.0.0-...-75e3292 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNotifier

func AddNotifier(uuid string, length int, time_tick time.Duration, time_out time.Duration) (chan int, chan int)

Send events about this uuid to buffered channel Also implement timer channel to simplify workflow

func DelNotifier

func DelNotifier(uuid string)

Types

type ExecResult

type ExecResult struct {
	ID        string   `json:"id"`
	Processed bool     `json:"processed"` // Was this command ever been processed?
	Command   string   `json:"command"`
	Args      []string `json:"args"`
	Status    int      `json:"status"`
	StdOut    string   `json:"stdout"` // base64-encoded
	StdErr    string   `json:"stderr"`
}

Command execution result

type Notifiers

type Notifiers struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type Report

type Report struct {
	ClientID  string        `json:"client_id"`
	MSG       string        `json:"msg"` // message.Topic, message.Partition, message.Offset
	ERROR     string        `json:"error,omitempty"`
	UUID      string        `json:"uuid,omitempty"`
	TAG       string        `json:"tag,omitempty"`
	PRODUCER  string        `json:"producer,omitempty"`
	RESULTS   []*ExecResult `json:"exec,omitempty"`
	TimeStamp string        `json:"timestamp,omitempty"`
}

type Reports

type Reports struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() *Reports

func (*Reports) Add

func (r *Reports) Add(report Report)

Store report, then try to notify caller party

func (*Reports) Clean

func (r *Reports) Clean(age time.Duration)

func (*Reports) Del

func (r *Reports) Del(uuid string)

func (*Reports) Get

func (r *Reports) Get(uuid string, index int) (Report, error)

type Timers

type Timers struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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