addons

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

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

func NewConsole

func NewConsole(runtime *js.Runtime, log log.Logger) *Console

func (*Console) Debug

func (c *Console) Debug(args ...js.Value)

func (*Console) Error

func (c *Console) Error(args ...js.Value)

func (*Console) Info

func (c *Console) Info(args ...js.Value)

func (*Console) Log

func (c *Console) Log(args ...js.Value)

func (*Console) Register

func (c *Console) Register(runtime *js.Runtime) error

func (*Console) Warn

func (c *Console) Warn(args ...js.Value)

type Encoding

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

func NewEncoding

func NewEncoding(runtime *js.Runtime) *Encoding

func (*Encoding) Base64decode

func (e *Encoding) Base64decode(args ...js.Value) js.Value

func (*Encoding) Base64encode

func (e *Encoding) Base64encode(args ...js.Value) js.Value

func (*Encoding) Register

func (e *Encoding) Register(runtime *js.Runtime) error

type Events

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

func NewEvents

func NewEvents(ctx context.Context, runtime *js.Runtime, channel chan<- events.Event) *Events

func (*Events) Push

func (e *Events) Push(args ...js.Value)

func (*Events) Register

func (e *Events) Register(runtime *js.Runtime) error

type Faker

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

func NewFaker

func NewFaker(runtime *js.Runtime) *Faker

func (*Faker) Bool

func (f *Faker) Bool() bool

Bool returns a random boolean value.

func (*Faker) Character

func (f *Faker) Character(args ...js.Value) string

Character returns a random character.

func (*Faker) Date

func (f *Faker) Date() js.Value

Date returns a random date.

func (*Faker) Domain

func (f *Faker) Domain() string

Domain returns a random domain.

func (*Faker) Email

func (f *Faker) Email() string

Email returns a random email.

func (*Faker) Falsy

func (f *Faker) Falsy() js.Value

Falsy returns a random falsy value.

func (*Faker) Floating

func (f *Faker) Floating() float32

Floating returns a random floating point number.

func (*Faker) Hash

func (f *Faker) Hash(args ...js.Value) string

Hash returns a random hash.

func (*Faker) Integer

func (f *Faker) Integer(args ...js.Value) int

Integer returns a random integer number.

func (*Faker) Ip

func (f *Faker) Ip() string

Ip returns a random IPv4 address.

func (*Faker) Ipv6

func (f *Faker) Ipv6() string

Ipv6 returns a random IPv6 address.

func (*Faker) Letter

func (f *Faker) Letter() string

Letter returns a random letter.

func (*Faker) Paragraph

func (f *Faker) Paragraph() string

Paragraph returns a random paragraph.

func (*Faker) Random

func (f *Faker) Random(args ...js.Value) js.Value

Random returns a randomly picked argument.

func (*Faker) Register

func (f *Faker) Register(runtime *js.Runtime) error

func (*Faker) String

func (f *Faker) String(args ...js.Value) string

String returns a random string.

func (*Faker) Tld

func (f *Faker) Tld() string

Tld returns a random top-level domain.

func (*Faker) Url

func (f *Faker) Url() string

Url returns a random URL.

func (*Faker) Uuid

func (f *Faker) Uuid() string

Uuid returns a random UUID.

func (*Faker) Word

func (f *Faker) Word() string

Word returns a random word.

type Fetch

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

func NewFetch

func NewFetch(ctx context.Context, client httpClient) *Fetch

func (*Fetch) Register

func (f *Fetch) Register(runtime *js.Runtime) error

type Hashing

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

func NewHashing

func NewHashing(runtime *js.Runtime) *Hashing

func (*Hashing) Md5

func (h *Hashing) Md5(args ...js.Value) js.Value

func (*Hashing) Register

func (h *Hashing) Register(runtime *js.Runtime) error

func (*Hashing) Sha256

func (h *Hashing) Sha256(args ...js.Value) js.Value

type IO

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

func NewIO

func NewIO(runtime *js.Runtime, stdOut, stdErr io.Writer, printer printer.Printer) *IO

func (*IO) Register

func (io *IO) Register(runtime *js.Runtime) error

func (*IO) StdErr

func (io *IO) StdErr(args ...js.Value)

func (*IO) StdOut

func (io *IO) StdOut(args ...js.Value)

type Process

type Process struct {
	Env map[string]string `json:"env"`
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(ctx context.Context, runtime *js.Runtime) *Process

func (*Process) Delay

func (p *Process) Delay(args ...js.Value)

Delay is a helper function for delaying script execution for a given duration.

func (*Process) Interrupt

func (p *Process) Interrupt(args ...js.Value)

Interrupt is a helper function for interrupting script execution.

func (*Process) Register

func (p *Process) Register(runtime *js.Runtime) error

Jump to

Keyboard shortcuts

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