contexts

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthContext

type AuthContext struct {
	User  *core.User
	Users map[string]*core.User
}

func (*AuthContext) AuthenticatedUser

func (c *AuthContext) AuthenticatedUser() *core.User

func (*AuthContext) GetUser

func (c *AuthContext) GetUser(id uuid.UUID) (*core.User, error)

func (*AuthContext) HasRole

func (c *AuthContext) HasRole(role string) (bool, error)

func (*AuthContext) InGroup

func (c *AuthContext) InGroup(group string) (bool, error)

type EventContext

type EventContext struct {
	Payloads []Payload
}

func (*EventContext) Count

func (e *EventContext) Count() int

func (*EventContext) Emit

func (e *EventContext) Emit(payloadType string, payload any) error

type ExecutionStateContext

type ExecutionStateContext struct {
	Finished       bool
	Passed         bool
	FailureReason  string
	FailureMessage string
	Channel        string
	Type           string
	Payloads       []any
	KVs            map[string]string
}

func (*ExecutionStateContext) Emit

func (c *ExecutionStateContext) Emit(channel, payloadType string, payloads []any) error

func (*ExecutionStateContext) Fail

func (c *ExecutionStateContext) Fail(reason, message string) error

func (*ExecutionStateContext) IsFinished

func (c *ExecutionStateContext) IsFinished() bool

func (*ExecutionStateContext) Pass

func (c *ExecutionStateContext) Pass() error

func (*ExecutionStateContext) SetKV

func (c *ExecutionStateContext) SetKV(key, value string) error

type HTTPContext added in v0.0.43

type HTTPContext struct {
	Requests  []*http.Request
	Responses []*http.Response
}

func (*HTTPContext) Do added in v0.0.43

func (c *HTTPContext) Do(request *http.Request) (*http.Response, error)

type IntegrationContext added in v0.5.0

type IntegrationContext struct {
	Configuration    map[string]any
	Metadata         any
	State            string
	StateDescription string
	BrowserAction    *core.BrowserAction
	Secrets          map[string]core.IntegrationSecret
	WebhookRequests  []any
	ResyncRequests   []time.Duration
	Subscriptions    []Subscription
}

func (*IntegrationContext) GetConfig added in v0.5.0

func (c *IntegrationContext) GetConfig(name string) ([]byte, error)

func (*IntegrationContext) GetMetadata added in v0.5.0

func (c *IntegrationContext) GetMetadata() any

func (*IntegrationContext) GetSecrets added in v0.5.0

func (c *IntegrationContext) GetSecrets() ([]core.IntegrationSecret, error)

func (*IntegrationContext) GetState added in v0.5.0

func (c *IntegrationContext) GetState() string

func (*IntegrationContext) ID added in v0.5.0

func (c *IntegrationContext) ID() uuid.UUID

func (*IntegrationContext) ListSubscriptions added in v0.5.0

func (c *IntegrationContext) ListSubscriptions() ([]core.IntegrationSubscriptionContext, error)

func (*IntegrationContext) NewBrowserAction added in v0.5.0

func (c *IntegrationContext) NewBrowserAction(action core.BrowserAction)

func (*IntegrationContext) RemoveBrowserAction added in v0.5.0

func (c *IntegrationContext) RemoveBrowserAction()

func (*IntegrationContext) RequestWebhook added in v0.5.0

func (c *IntegrationContext) RequestWebhook(configuration any) error

func (*IntegrationContext) ScheduleResync added in v0.5.0

func (c *IntegrationContext) ScheduleResync(interval time.Duration) error

func (*IntegrationContext) SetMetadata added in v0.5.0

func (c *IntegrationContext) SetMetadata(metadata any)

func (*IntegrationContext) SetSecret added in v0.5.0

func (c *IntegrationContext) SetSecret(name string, value []byte) error

func (*IntegrationContext) SetState added in v0.5.0

func (c *IntegrationContext) SetState(state, stateDescription string)

func (*IntegrationContext) Subscribe added in v0.5.0

func (c *IntegrationContext) Subscribe(subscription any) (*uuid.UUID, error)

type MetadataContext

type MetadataContext struct {
	Metadata any
}

func (*MetadataContext) Get

func (m *MetadataContext) Get() any

func (*MetadataContext) Set

func (m *MetadataContext) Set(metadata any) error

type Payload

type Payload struct {
	Type string
	Data any
}

type RequestContext

type RequestContext struct {
	Duration time.Duration
	Action   string
	Params   map[string]any
}

func (*RequestContext) ScheduleActionCall

func (c *RequestContext) ScheduleActionCall(action string, params map[string]any, duration time.Duration) error

type Subscription added in v0.0.45

type Subscription struct {
	ID            uuid.UUID
	Configuration any
}

type WebhookContext

type WebhookContext struct {
	Secret string
}

func (*WebhookContext) GetBaseURL added in v0.0.18

func (w *WebhookContext) GetBaseURL() string

func (*WebhookContext) GetSecret

func (w *WebhookContext) GetSecret() ([]byte, error)

func (*WebhookContext) ResetSecret added in v0.0.18

func (w *WebhookContext) ResetSecret() ([]byte, []byte, error)

func (*WebhookContext) SetSecret added in v0.0.18

func (w *WebhookContext) SetSecret(secret []byte) error

func (*WebhookContext) Setup

func (w *WebhookContext) Setup() (string, error)

Jump to

Keyboard shortcuts

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