util

package
v0.0.0-...-a2b917b Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debuglog

func Debuglog(ctx context.Context, section string, callback *isolates.Value) (*isolates.Value, error)

func Deprecate

func Deprecate(fn *isolates.Value, msg ...*isolates.Value) (isolates.Function, error)

func Format

func Format(ctx context.Context, argsv ...any) (string, error)

func FormatWithOptions

func FormatWithOptions(ctx context.Context, options any, argsv ...any) (string, error)

func Inherits

func Inherits(ctx context.Context, constructor *isolates.Value, superConstructor *isolates.Value) (*isolates.Value, error)

func Inspect

func Inspect(ctx context.Context, object any, args ...any) (string, error)

func Promisify

func Promisify(ctx context.Context, fn *isolates.Value) (isolates.Function, error)

Types

type Counter

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

func NewCounter

func NewCounter(size int64, duration time.Duration) *Counter

func (*Counter) Add

func (c *Counter) Add(value int64, now time.Time) *Counter

func (*Counter) AddDuration

func (c *Counter) AddDuration(from time.Time, to time.Time) *Counter

func (*Counter) AddDurationNow

func (c *Counter) AddDurationNow(from time.Time) *Counter

func (*Counter) AddNow

func (c *Counter) AddNow(value int64) *Counter

func (*Counter) Clone

func (c *Counter) Clone(ctx context.Context) (*Counter, error)

func (*Counter) FloorTime

func (c *Counter) FloorTime(now time.Time) time.Time

func (*Counter) Sub

func (c *Counter) Sub(value int64, now time.Time) *Counter

func (*Counter) Sum

func (c *Counter) Sum(duration time.Duration, now time.Time) int64

func (*Counter) SumAll

func (c *Counter) SumAll(now time.Time) int64

func (*Counter) SumAllDuration

func (c *Counter) SumAllDuration(now time.Time) time.Duration

func (*Counter) SumAllDurationNow

func (c *Counter) SumAllDurationNow() time.Duration

func (*Counter) SumAllNow

func (c *Counter) SumAllNow() int64

func (*Counter) SumDuration

func (c *Counter) SumDuration(duration time.Duration, now time.Time) time.Duration

func (*Counter) SumDurationNow

func (c *Counter) SumDurationNow(duration time.Duration) time.Duration

func (*Counter) SumNow

func (c *Counter) SumNow(duration time.Duration) int64

func (*Counter) V8FuncAdd

func (c *Counter) V8FuncAdd(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncAddDuration

func (c *Counter) V8FuncAddDuration(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncAddDurationNow

func (c *Counter) V8FuncAddDurationNow(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncAddNow

func (c *Counter) V8FuncAddNow(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncClone

func (c *Counter) V8FuncClone(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncFloorTime

func (c *Counter) V8FuncFloorTime(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSub

func (c *Counter) V8FuncSub(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSum

func (c *Counter) V8FuncSum(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSumAll

func (c *Counter) V8FuncSumAll(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSumAllDuration

func (c *Counter) V8FuncSumAllDuration(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSumAllDurationNow

func (c *Counter) V8FuncSumAllDurationNow(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSumAllNow

func (c *Counter) V8FuncSumAllNow(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSumDuration

func (c *Counter) V8FuncSumDuration(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSumDurationNow

func (c *Counter) V8FuncSumDurationNow(in isolates.FunctionArgs) (*isolates.Value, error)

func (*Counter) V8FuncSumNow

func (c *Counter) V8FuncSumNow(in isolates.FunctionArgs) (*isolates.Value, error)

type Import

type Import struct{}

type InspectOptions

type InspectOptions struct {
	ShowHidden       bool `v8:"showHidden"`
	Depth            int  `v8:"depth"`
	Colors           bool `v8:"colors"`
	CustomInspect    bool `v8:"customInspect"`
	ShowProxy        bool `v8:"showProxy"`
	MaxArrayLength   int  `v8:"maxArrayLength"`
	MaxStringLength  int  `v8:"maxStringLength"`
	BreakLength      int  `v8:"breakLength"`
	Compact          any  `v8:"compact"`
	Sorted           any  `v8:"sorted"`
	Getters          any  `v8:"getters"`
	NumericSeparator bool `v8:"numericSeparator"`
}

type Inspector

type Inspector struct {
	*stream.DuplexBase
	// contains filtered or unexported fields
}

func NewInspector

func NewInspector(in isolates.FunctionArgs) (*Inspector, error)

Jump to

Keyboard shortcuts

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