js

package
v0.22.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JS

type JS struct {
	Output      io.Writer
	Runtime     *goja.Runtime
	Now         NowFunc
	ScanFn      ScanFunc
	ScanRequest *v1.Scan
}

func New

func New() *JS

func (*JS) GetNow

func (o *JS) GetNow() time.Time

func (*JS) Print

func (o *JS) Print(args ...any)

func (*JS) PrintLn

func (o *JS) PrintLn(args ...any)

func (*JS) Release

func (o *JS) Release()

func (*JS) RenderMetricsData

func (o *JS) RenderMetricsData(data *metricsv1.MetricsData, opts render.MetricsFormatOption)

func (*JS) RenderMetricsDataJSON

func (o *JS) RenderMetricsDataJSON(data *metricsv1.MetricsData, opts render.JSONOptions) error

func (*JS) Reset

func (o *JS) Reset()

func (*JS) Run

func (o *JS) Run(program *goja.Program) error

func (*JS) Scan

func (r *JS) Scan(a *v1.Scan) (*v1.Data, error)

func (*JS) WithData

func (o *JS) WithData(data *v1.Data) *JS

func (*JS) WithNow

func (o *JS) WithNow(now NowFunc) *JS

func (*JS) WithOutput

func (o *JS) WithOutput(w io.Writer) *JS

func (*JS) WithScan

func (o *JS) WithScan(f ScanFunc) *JS

type NowFunc

type NowFunc func() time.Time

type Scan

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

func (*Scan) Ago

func (s *Scan) Ago(duration string) error

func (*Scan) Attr

func (s *Scan) Attr(key, value string)

func (*Scan) Create

func (s *Scan) Create(resource string) *Scan

func (*Scan) Limit

func (s *Scan) Limit(limit int64)

func (*Scan) LogLevel

func (s *Scan) LogLevel(lvl string)

func (*Scan) Name

func (s *Scan) Name(name string)

func (*Scan) Now

func (s *Scan) Now(ms int64)

func (*Scan) Offset

func (s *Scan) Offset(duration string) error

func (*Scan) ParentSpanID

func (s *Scan) ParentSpanID(id string)

func (*Scan) Resource

func (s *Scan) Resource(resource string)

func (*Scan) ResourceAttr

func (s *Scan) ResourceAttr(key, value string)

func (*Scan) ResourceSchema

func (s *Scan) ResourceSchema(schema string)

func (*Scan) Reverse

func (s *Scan) Reverse()

func (*Scan) Scan

func (s *Scan) Scan() *v1.Scan

func (*Scan) ScopeAttr

func (s *Scan) ScopeAttr(key, value string)

func (*Scan) ScopeName

func (s *Scan) ScopeName(name string)

func (*Scan) ScopeSchema

func (s *Scan) ScopeSchema(schema string)

func (*Scan) ScopeVersion

func (s *Scan) ScopeVersion(version string)

func (*Scan) SpanID

func (s *Scan) SpanID(id string)

func (*Scan) ThisMonth

func (s *Scan) ThisMonth()

func (*Scan) ThisWeek

func (s *Scan) ThisWeek()

func (*Scan) ThisYear

func (s *Scan) ThisYear()

func (*Scan) TimeRange

func (s *Scan) TimeRange(from, to int64)

func (*Scan) Today

func (s *Scan) Today()

func (*Scan) TraceID

func (s *Scan) TraceID(id string)

type ScanFunc

type ScanFunc func(*v1.Scan) (*v1.Data, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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