contexts

package
v0.0.41 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInstallationContext

type AppInstallationContext struct {
	Metadata         any
	State            string
	StateDescription string
	BrowserAction    *core.BrowserAction
	Secrets          map[string]core.InstallationSecret
	WebhookRequests  []any
	ResyncRequests   []time.Duration
}

func (*AppInstallationContext) GetConfig

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

func (*AppInstallationContext) GetMetadata

func (c *AppInstallationContext) GetMetadata() any

func (*AppInstallationContext) GetSecrets

func (c *AppInstallationContext) GetSecrets() ([]core.InstallationSecret, error)

func (*AppInstallationContext) GetState

func (c *AppInstallationContext) GetState() string

func (*AppInstallationContext) ID

func (*AppInstallationContext) NewBrowserAction

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

func (*AppInstallationContext) RemoveBrowserAction

func (c *AppInstallationContext) RemoveBrowserAction()

func (*AppInstallationContext) RequestWebhook

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

func (*AppInstallationContext) ScheduleResync added in v0.0.21

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

func (*AppInstallationContext) SetMetadata

func (c *AppInstallationContext) SetMetadata(metadata any)

func (*AppInstallationContext) SetSecret

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

func (*AppInstallationContext) SetState

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

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 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 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(options *core.WebhookSetupOptions) (string, error)

Jump to

Keyboard shortcuts

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