instruction

package
v0.0.0-...-891d188 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrencyType

type ConcurrencyType int
const (
	// No concurrency: instructions execute in serial.
	ConcurrencyTypeNone ConcurrencyType = iota
	// Per-user concurrency: User requests execute in serial but multiple users can have concurrent requests.
	ConcurrencyTypePerUser
	// All concurrency: All requests are executed at the same time.
	ConcurrencyTypeAll
)

type Instr

type Instr struct {
	UserID  string
	Method  string
	Path    string
	Queries map[string]string
	Body    interface{}
	Store   map[string]string
}

An instruction for the runner to run.

type RunOpts

type RunOpts struct {
	Concurrency    ConcurrencyType
	HSURL          string
	StoreNamespace string
}

type Runner

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

func NewRunner

func NewRunner(blueprintName string, bestEffort, debugLogging bool) *Runner

func (*Runner) AccessTokens

func (r *Runner) AccessTokens(hsDomain string) map[string]string

AccessTokens returns the access tokens for all users who were created on the given HS domain. Returns a map of user_id => access_token

func (*Runner) DeviceIDs

func (r *Runner) DeviceIDs(hsDomain string) map[string]string

DeviceIDs returns the device ids for all users who were created on the given HS domain. Returns a map of user_id => device_id

func (*Runner) GetStoredValue

func (r *Runner) GetStoredValue(opts RunOpts, key string) string

Load a previously stored value from RunInstructions

func (*Runner) Run

func (r *Runner) Run(hs b.Homeserver, hsURL string) (resErr error)

Run all instructions until completion. Return an error if there was a problem executing any instruction.

func (*Runner) RunInstructions

func (r *Runner) RunInstructions(opts RunOpts, instrs []Instr) (resErr error)

RunInstructions runs custom instruction sets on this runner.

Jump to

Keyboard shortcuts

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