resource

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: AGPL-3.0 Imports: 52 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EventConnectionStatus = "connection/status"
	EventSourceState      = "source/STATE"
)

Event constants for resource controller events.

View Source
const EventConnectionMetadata = "resource/connection/metadata"
View Source
const PluginName = "resource"

Variables

This section is empty.

Functions

func GraphChangedEventKey added in v0.4.2

func GraphChangedEventKey(pluginID, connectionID string) string

GraphChangedEventKey is the event emitted when edges touching a connection change. The payload is {"pluginId": ..., "connectionId": ...}.

func WithAdmissionBatch added in v0.33.0

func WithAdmissionBatch(ctx context.Context) context.Context

WithAdmissionBatch scopes reference admissions made with the returned context to one sequential admission pass: the route catalog, its validation and the authority resolution for a resource type are acquired once and shared by the admissions that follow. Every reference is still individually authorized, address-checked and generation-fenced. The batch does not coordinate overlapping admissions, so never share it between goroutines. Discard the context when the pass completes; never retain it across deliveries, where a catalog or authority may have changed.

func WithObservation added in v0.12.0

func WithObservation(ctx context.Context, observation Observation) context.Context

WithObservation retains discovery provenance until the actual native admission.

Types

type ActionEventDTO added in v0.6.0

type ActionEventDTO struct {
	Type     string                           `json:"type"`
	Data     *resourcev2.Value                `json:"data,omitempty"`
	Error    *apperror.AppError               `json:"error,omitempty"`
	Activity *resourcev2.ActivityPresentation `json:"activity,omitempty"`
}

type ActionSnapshot added in v0.6.0

type ActionSnapshot struct {
	Sequence uint64         `json:"sequence"`
	Event    ActionEventDTO `json:"event"`
	Terminal bool           `json:"terminal"`
}

type AuthorityEvidence added in v0.12.0

type AuthorityEvidence struct {
	Continuity  string   `json:"continuity"`
	Limitations []string `json:"limitations"`
}

type AuthorityResolution added in v0.12.0

type AuthorityResolution struct {
	Authority   string
	Continuity  string
	Limitations []string
	Changed     bool
}

AuthorityResolution is host identity evidence, never authorization or permission to share bodies, caches, or projections. Changed requires acquisition invalidation.

type AuthorityResolver added in v0.12.0

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

AuthorityResolver owns one plugin-scoped store. The controller must retain one resolver per store; concurrent resolver instances must not write the same store. Equal validated hints may share only within one coherent connection catalog. No native scheme is reviewed for stable continuity across routes or epochs. Missing hints cannot detect retargeting. Deleting local state loses continuity. No incarnation is inferred. Neither endpoints nor credentials are inspected.

func NewAuthorityResolver added in v0.12.0

func NewAuthorityResolver(root *appstate.ScopedRoot) (*AuthorityResolver, error)

func (*AuthorityResolver) InvalidateConnection added in v0.12.0

func (r *AuthorityResolver) InvalidateConnection(pluginID, connectionID string) error

InvalidateConnection retires every provider binding for an explicitly changed route. Retargeting must not reuse authority merely because its hint is equal. A failed durable write restores the old in-memory bindings and returns error.

func (*AuthorityResolver) Matches added in v0.12.0

func (r *AuthorityResolver) Matches(pluginID, connectionID, provider, resourceType, authority string) bool

Matches checks a current host-issued binding without creating identity state.

func (*AuthorityResolver) ObserveCatalog added in v0.12.0

func (r *AuthorityResolver) ObserveCatalog(pluginID, connectionID string, catalog resourcev2.Catalog) (map[string]AuthorityResolution, error)

ObserveCatalog atomically assigns all Types in one validated source observation. Nil hints remain Type-local. Equal typed hints share a host-issued backing ID only in this route's current catalog. A surviving member with the same typed hint justifies reusing its active cohort ID when Types join, leave, or return. With no such current member, a fresh ID is issued; historical cohorts are never searched or resurrected. Removed Types and replaced providers are retired. Saved references are never rewritten to a replacement authority.

type BorrowableConnection added in v0.27.0

type BorrowableConnection struct {
	ID      string
	Name    string
	Started bool
}

BorrowableConnection is an ID/name-only host observation; it contains no profile.

type ConnectionProfile added in v0.12.0

type ConnectionProfile struct {
	ID         string            `json:"id"`
	Source     string            `json:"source"`
	Connection *types.Connection `json:"connection,omitempty"`
	Active     bool              `json:"active"`
}

ConnectionProfile separates source facts, explicit desired state, and passive legacy review candidates. Active means effective source inventory membership, not connected/readiness. Disabled native configurations never mutate source files.

type ConnectionProfileCredentials added in v0.20.0

type ConnectionProfileCredentials struct {
	Username *string `json:"username,omitempty"`
	Token    *string `json:"token,omitempty"`
}

ConnectionProfileCredentials is write-only. Omitted fields preserve existing values only for the same ID, UID, and canonical Data; an explicit empty string clears that value. Changing identity or Data does not inherit credentials.

type ConnectionProfileResult added in v0.12.0

type ConnectionProfileResult struct {
	Applied bool              `json:"applied"`
	Profile ConnectionProfile `json:"profile"`
}

type ConnectionReader added in v0.12.0

type ConnectionReader interface {
	GetConnection(ctx context.Context, pluginID string, connectionID string) (types.Connection, error)
}

ConnectionReader is the native connection lookup required by resource utilities.

type ConnectionState added in v0.2.0

type ConnectionState struct {
	// Connection metadata (name, avatar, labels, etc.)
	Connection types.Connection `json:"connection"`

	// Registered native-client state, not network health. UNKNOWN is not stopped.
	Readiness      types.ConnectionStatusCode `json:"readiness"`
	ReadinessError *apperror.AppError         `json:"readinessError,omitempty"`

	// Per-resource source states (resource key → source state).
	Resources map[string]string `json:"resources"`

	// Observed cache membership, not source totals.
	ResourceCounts map[string]sdkresource.Count `json:"resourceCounts"`

	// Aggregate counts computed server-side.
	TotalResources int `json:"totalResources"`
	SyncedCount    int `json:"syncedCount"`
	ErrorCount     int `json:"errorCount"`

	// ISO 8601 timestamp of the last successful sync, or empty if never synced.
	// String instead of time.Time for Wails serialization compatibility.
	LastSyncTime string `json:"lastSyncTime,omitempty"`
}

ConnectionState is the full state snapshot for a single connection, combining metadata, lifecycle, and source state. Returned by GetAllConnectionStates so the frontend can hydrate everything in a single call.

type ConnectionStatusPayload added in v0.4.0

type ConnectionStatusPayload struct {
	PluginID     string `json:"pluginID"`
	ConnectionID string `json:"connectionID"`
	Status       string `json:"status"`
	Name         string `json:"name"`
}

ConnectionStatusPayload is emitted when a connection's status changes.

type Controller

type Controller interface {
	plugintypes.LifecycleController
	Run(context.Context)
	Service
	SetCrashCallback(cb func(pluginID string))
	// RetireSourceOwner releases a native window's sources without exposing a browser binding.
	RetireSourceOwner(owner string)
	Graph() *graph.RelationshipGraph
	ValidateReference(context.Context, string, resource.AccessRoute, resource.ResourceReference) error
	SetConnectionChangeHook(func(pluginID, connectionID string) func())
	AdmitReference(context.Context, string, string, resource.AccessRoute, resource.ResourceReference) (context.Context, error)
	ReadObservedResource(context.Context, string, resource.AccessRoute, resource.ResourceReference, []string) (*resource.Value, func(context.Context) error, error)
	GuardObservedReference(context.Context, string, string, resource.AccessRoute, resource.ResourceReference) (func(context.Context) error, error)
}

Controller is the lifecycle + service interface for the resource capability.

func NewController

func NewController(
	logger logging.Logger,
	sp pkgsettings.Provider,
	pluginStoreFn func(string) (*appstate.ScopedRoot, error),
	boundary *invocation.Boundary,
) Controller

NewController creates a new resource Controller. pluginStoreFn returns a ScopedRoot for the given plugin's store directory.

type EditorSchemaAssociation added in v0.27.0

type EditorSchemaAssociation struct {
	Type           string `json:"type"`
	Representation string `json:"representation,omitempty"`
	Key            string `json:"key,omitempty"`
	Language       string `json:"language"`
	ModelDirectory string `json:"modelDirectory"` // "file:///omniview-schema/<hex16>"
	FileMatch      string `json:"fileMatch"`      // "**/omniview-schema/<hex16>/*"
	DocumentID     string `json:"documentId,omitempty"`
	Root           string `json:"root,omitempty"`
	Status         string `json:"status"` // "available"|"absent"|"unavailable"|"unsupported"|"invalid"|"limit"
	Code           string `json:"code,omitempty"`
}

EditorSchemaAssociation binds a host-derived Monaco model directory to a rendered catalog document.

type EditorSchemaDocument added in v0.27.0

type EditorSchemaDocument struct {
	DocumentID string          `json:"documentId"`
	Schema     json.RawMessage `json:"schema"`
}

EditorSchemaDocument is a host-rendered draft-07 editor document.

type EventEmitter added in v0.2.0

type EventEmitter interface {
	Emit(eventKey string, data ...any)
}

EventEmitter abstracts event emission for testability. Production uses appEmitter; tests use recordingEmitter.

func NewAppEmitter added in v0.4.1

func NewAppEmitter(app *application.App) EventEmitter

NewAppEmitter returns an EventEmitter that emits through the given Wails app.

type GraphService added in v0.3.0

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

GraphService exposes observed relationships and rejects incomplete whole results.

func NewGraphService added in v0.3.0

func (*GraphService) GetDependencyTree added in v0.3.0

func (s *GraphService) GetDependencyTree(ctx context.Context, pluginID string, reference resourcev2.ResourceReference, route resourcev2.AccessRoute, maxDepth int) (_result *graph.DependencyTree, retErr error)

func (*GraphService) GetRelated added in v0.3.0

func (s *GraphService) GetRelated(ctx context.Context, pluginID string, reference resourcev2.ResourceReference, route resourcev2.AccessRoute, direction string, relType *string) (_result []graph.GraphEdge, retErr error)

func (*GraphService) GetRelationshipChain added in v0.3.0

func (s *GraphService) GetRelationshipChain(ctx context.Context, pluginID string, reference resourcev2.ResourceReference, route resourcev2.AccessRoute, relType string, maxDepth int) (_result [][]graph.GraphEdge, retErr error)

func (*GraphService) GetSubgraph added in v0.4.2

func (s *GraphService) GetSubgraph(ctx context.Context, pluginID string, reference resourcev2.ResourceReference, route resourcev2.AccessRoute, upDepth, downDepth int) (_result *graph.Subgraph, retErr error)

type HostConnectionMetadata added in v0.13.0

type HostConnectionMetadata struct {
	PluginID           string                                 `json:"pluginID"`
	RegistrationID     string                                 `json:"registrationID"`
	Supported          bool                                   `json:"supported"`
	TransportAvailable bool                                   `json:"transportAvailable"`
	ConnectionID       string                                 `json:"connectionID,omitempty"`
	Revision           string                                 `json:"revision,omitempty"`
	Snapshot           *resourcev2.ConnectionMetadataSnapshot `json:"snapshot,omitempty"`
	Removed            bool                                   `json:"removed,omitempty"`
}

HostConnectionMetadata adds transport identity without changing SDK-owned facts. A provider-wide event omits ConnectionID and Snapshot.

type HostEnumerateRequest added in v0.12.0

type HostEnumerateRequest struct {
	TargetID string                      `json:"targetId"`
	Request  resourcev2.EnumerateRequest `json:"request"`
}

func (*HostEnumerateRequest) UnmarshalJSON added in v0.12.0

func (request *HostEnumerateRequest) UnmarshalJSON(data []byte) error

type HostGetRequest added in v0.12.0

type HostGetRequest struct {
	TargetID string                `json:"targetId"`
	Request  resourcev2.GetRequest `json:"request"`
}

func (*HostGetRequest) UnmarshalJSON added in v0.12.0

func (request *HostGetRequest) UnmarshalJSON(data []byte) error

type HostNativeQueryRequest added in v0.12.0

type HostNativeQueryRequest struct {
	TargetID string                        `json:"targetId"`
	Request  resourcev2.NativeQueryRequest `json:"request"`
}

func (*HostNativeQueryRequest) UnmarshalJSON added in v0.12.0

func (request *HostNativeQueryRequest) UnmarshalJSON(data []byte) error

type HostRecord added in v0.12.0

type HostRecord struct {
	Key        string                 `json:"key"`
	AddressKey string                 `json:"addressKey"`
	TargetID   string                 `json:"targetId"`
	Record     resourcev2.Record      `json:"record"`
	Route      resourcev2.AccessRoute `json:"route"`
}

These host envelopes add acquisition membership, never a second resource identity. Source cursors remain native cursors, not host query continuations.

type HostRecordRemoval added in v0.24.0

type HostRecordRemoval struct {
	Key        string `json:"key"`
	AddressKey string `json:"addressKey"`
}

type HostSourcePage added in v0.12.0

type HostSourcePage struct {
	Records    []HostRecord       `json:"records"`
	SourcePage SourcePageMetadata `json:"sourcePage"`
}

type HostSourceStateEvent added in v0.24.0

type HostSourceStateEvent struct {
	PluginID string                 `json:"pluginID"`
	Route    resourcev2.AccessRoute `json:"route"`
	Type     string                 `json:"type"`
	Status   HostSourceStatus       `json:"status"`
}

type HostSourceStates added in v0.24.0

type HostSourceStates struct {
	Route resourcev2.AccessRoute      `json:"route"`
	Types map[string]HostSourceStatus `json:"types"`
}

type HostSourceStatus added in v0.24.0

type HostSourceStatus struct {
	State      string                             `json:"state"`
	Mode       string                             `json:"mode"`
	Continuity string                             `json:"continuity,omitempty"`
	Coverage   *resourcev2.SourceCoverage         `json:"coverage,omitempty"`
	Count      resourcev2.Count                   `json:"count"`
	Error      *resourcev2.ResourceOperationError `json:"error,omitempty"`
}

type HostSourceViewEvent added in v0.24.0

type HostSourceViewEvent struct {
	ViewID         string               `json:"viewId"`
	ViewGeneration string               `json:"viewGeneration"`
	Sequence       string               `json:"sequence"`
	Kind           string               `json:"kind"`
	Records        []HostRecord         `json:"records,omitempty"`
	Upserts        []HostRecord         `json:"upserts,omitempty"`
	Removes        []HostRecordRemoval  `json:"removes,omitempty"`
	Status         *HostSourceStatus    `json:"status,omitempty"`
	Reset          *HostSourceViewReset `json:"reset,omitempty"`
}

type HostSourceViewOpened added in v0.24.0

type HostSourceViewOpened struct {
	ViewID string `json:"viewId"`
	Topic  string `json:"topic"`
	Mode   string `json:"mode"`
}

type HostSourceViewRequest added in v0.24.0

type HostSourceViewRequest struct {
	TargetID string                `json:"targetId"`
	Target   resourcev2.ReadTarget `json:"target"`
	Updates  string                `json:"updates"`
}

func (*HostSourceViewRequest) UnmarshalJSON added in v0.24.0

func (request *HostSourceViewRequest) UnmarshalJSON(data []byte) error

type HostSourceViewReset added in v0.24.0

type HostSourceViewReset struct {
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

type NoopEmitter added in v0.4.0

type NoopEmitter struct{}

NoopEmitter silently discards all events. Used before the app is initialized.

func (NoopEmitter) Emit added in v0.4.0

func (NoopEmitter) Emit(string, ...any)

type Observation added in v0.12.0

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

Observation is an opaque, retained advertisement of one native route catalog. Its private admission identity cannot be supplied by an external caller.

func (Observation) DiscoveryContext added in v0.27.0

func (o Observation) DiscoveryContext(ctx context.Context) context.Context

DiscoveryContext enables request-scoped reuse for read-only tool discovery. Call ValidateDiscovery before publishing any result built with this context.

func (Observation) ValidateDiscovery added in v0.27.0

func (o Observation) ValidateDiscovery(ctx context.Context) error

ValidateDiscovery fences publication after all read-only discovery calls. Operations still acquire and admit their own current catalog independently.

type ReferenceAdmitter added in v0.12.0

ReferenceAdmitter admits a native utility against one exact resource catalog. It does not fetch a resource body or grant resource Get permission.

type ResolveReferenceRequest added in v0.12.0

type ResolveReferenceRequest struct {
	Route          resourcev2.AccessRoute  `json:"route"`
	Type           string                  `json:"type"`
	Scope          []resourcev2.ScopeEntry `json:"scope"`
	ID             string                  `json:"id"`
	Incarnation    *string                 `json:"incarnation,omitempty"`
	Representation string                  `json:"representation,omitempty"`
}

func (*ResolveReferenceRequest) UnmarshalJSON added in v0.12.0

func (request *ResolveReferenceRequest) UnmarshalJSON(data []byte) error

type ResolveTargetRequest added in v0.12.0

type ResolveTargetRequest struct {
	Route          resourcev2.AccessRoute `json:"route"`
	Type           string                 `json:"type"`
	Representation string                 `json:"representation,omitempty"`
	Scope          resourcev2.QueryScope  `json:"scope"`
}

func (*ResolveTargetRequest) UnmarshalJSON added in v0.12.0

func (request *ResolveTargetRequest) UnmarshalJSON(data []byte) error

type ResolvedReference added in v0.12.0

type ResolvedReference struct {
	Reference      resourcev2.ResourceReference `json:"reference"`
	Route          resourcev2.AccessRoute       `json:"route"`
	Key            string                       `json:"key"`
	AddressKey     string                       `json:"addressKey"`
	TargetID       string                       `json:"targetId"`
	Representation string                       `json:"representation"`
	Authority      AuthorityEvidence            `json:"authority"`
}

type ResolvedTarget added in v0.12.0

type ResolvedTarget struct {
	TargetID        string                `json:"targetId"`
	Target          resourcev2.ReadTarget `json:"target"`
	Authority       AuthorityEvidence     `json:"authority"`
	CatalogRevision string                `json:"catalogRevision"`
}

type ResourceProvider added in v0.2.0

type ResourceProvider interface {
	resourcev2.Provider
}

ResourceProvider is the canonical provider-facing boundary. Catalog is the only required operation. Callers discover optional operation interfaces and qualified catalog support independently; transport messages never escape here.

type SchemaFieldsRequest added in v0.27.0

type SchemaFieldsRequest struct {
	Route          resourcev2.AccessRoute        `json:"route"`
	Type           string                        `json:"type"`
	Representation string                        `json:"representation,omitempty"`
	Path           []resourcecatalog.PathSegment `json:"path"`
}

SchemaFieldsRequest selects one navigation position in a representation schema.

type SchemaFieldsResult added in v0.27.0

type SchemaFieldsResult struct {
	CatalogRevision  string                      `json:"catalogRevision"`
	Type             string                      `json:"type"`
	Representation   string                      `json:"representation"`
	SchemaState      string                      `json:"schemaState"` // provider state: absent|available|unavailable
	SchemaRevision   string                      `json:"schemaRevision,omitempty"`
	Dialect          string                      `json:"dialect,omitempty"`
	Overlay          resourcecatalog.TypeOverlay `json:"overlay"`
	Fields           []resourcecatalog.FieldInfo `json:"fields"`
	Truncated        bool                        `json:"truncated"`
	TruncationReason string                      `json:"truncationReason,omitempty"`
}

SchemaFieldsResult is catalog-derived field discovery for one representation.

type Service added in v0.2.0

type Service interface {
	ListPlugins(ctx context.Context) ([]string, error)
	HasPlugin(ctx context.Context, pluginID string) (bool, error)
	Features(ctx context.Context, pluginID string) (resourcev2.FeatureSet, error)
	Catalog(ctx context.Context, pluginID string, request resourcev2.CatalogRequest) (resourcev2.Catalog, error)
	ResolveTarget(ctx context.Context, pluginID string, request ResolveTargetRequest) (ResolvedTarget, error)
	ResolveReference(ctx context.Context, pluginID string, request ResolveReferenceRequest) (ResolvedReference, error)
	Get(ctx context.Context, pluginID string, request HostGetRequest) (HostRecord, error)
	Enumerate(ctx context.Context, pluginID string, request HostEnumerateRequest) (HostSourcePage, error)
	NativeQuery(ctx context.Context, pluginID string, request HostNativeQueryRequest) (HostSourcePage, error)
	Mutate(ctx context.Context, pluginID string, request resourcev2.MutationRequest) (resourcev2.Record, error)
	Action(ctx context.Context, pluginID string, request resourcev2.ActionRequest) (resourcev2.Value, error)

	StartConnection(ctx context.Context, pluginID string, connectionID string) (types.ConnectionStatus, error)
	StopConnection(ctx context.Context, pluginID string, connectionID string) (types.Connection, error)
	CheckConnection(ctx context.Context, pluginID string, connectionID string) (types.ConnectionStatus, error)
	LoadConnections(ctx context.Context, pluginID string) ([]types.Connection, error)
	ListConnections(ctx context.Context, pluginID string) ([]types.Connection, error)
	ListAllConnections(ctx context.Context) (map[string][]types.Connection, error)
	GetAllConnectionStates(ctx context.Context) (map[string][]ConnectionState, error)
	GetConnection(ctx context.Context, pluginID string, connectionID string) (types.Connection, error)
	GetConnectionMetadata(ctx context.Context, pluginID, connectionID string) (HostConnectionMetadata, error)
	RefreshConnectionMetadata(ctx context.Context, pluginID, connectionID string) (HostConnectionMetadata, error)
	ScopeValues(ctx context.Context, pluginID string, route resourcev2.AccessRoute, dimension string) ([]string, error)
	SaveConnectionProfile(ctx context.Context, pluginID string, connection types.Connection, credentials *ConnectionProfileCredentials) (ConnectionProfileResult, error)
	ListConnectionProfiles(ctx context.Context, pluginID string) ([]ConnectionProfile, error)
	ImportConnectionProfile(ctx context.Context, pluginID string, connectionID string) (ConnectionProfileResult, error)
	ResetConnectionProfile(ctx context.Context, pluginID string, connectionID string) (ConnectionProfileResult, error)
	RemoveConnection(ctx context.Context, pluginID string, connectionID string) error

	OpenSourceView(ctx context.Context, pluginID string, request HostSourceViewRequest) (HostSourceViewOpened, error)
	SyncSourceView(ctx context.Context, pluginID, viewID string) error
	RefreshSourceView(ctx context.Context, pluginID, viewID string) error
	CloseSourceView(ctx context.Context, pluginID, viewID string) error
	GetSourceStates(ctx context.Context, pluginID string, route resourcev2.AccessRoute) (HostSourceStates, error)
	RetryConnectionSources(ctx context.Context, pluginID string, route resourcev2.AccessRoute) error

	GetResourceGroups(ctx context.Context, pluginID string, route resourcev2.AccessRoute) ([]resourcev2.ResourceGroup, error)
	GetResourceDefinition(ctx context.Context, pluginID string, route resourcev2.AccessRoute, resourceType string) (resourcev2.ResourceDefinition, error)
	GetSchemaFields(ctx context.Context, pluginID string, request SchemaFieldsRequest) (SchemaFieldsResult, error)
	CompletePredicate(ctx context.Context, pluginID string, request resourceauthoring.CompletionRequest) (resourceauthoring.CompletionResponse, error)
	GetEditorSchemas(ctx context.Context, pluginID string, route resourcev2.AccessRoute) ([]EditorSchemaAssociation, error)
	GetEditorSchemaDocument(ctx context.Context, pluginID string, route resourcev2.AccessRoute, documentID string) (EditorSchemaDocument, error)
	GetSchemaDocument(ctx context.Context, pluginID string, route resourcev2.AccessRoute, reference resourcev2.SchemaDocumentReference) (resourcev2.SchemaDocument, error)
	GetRelationships(ctx context.Context, pluginID string, route resourcev2.AccessRoute, resourceType string) ([]resourcev2.RelationshipDescriptor, error)
	ResolveRelationships(ctx context.Context, pluginID string, request resourcev2.GetRequest) ([]resourcev2.ResolvedRelationship, error)
	GetHealth(ctx context.Context, pluginID string, request resourcev2.GetRequest, body resourcev2.Value) (*resourcev2.ResourceHealth, error)
	GetResourceEvents(ctx context.Context, pluginID string, request resourcev2.GetRequest, limit uint32) ([]resourcev2.ResourceEvent, error)
	GetActions(ctx context.Context, pluginID string, route resourcev2.AccessRoute, resourceType string) ([]resourcev2.ActionDescriptor, error)
	StreamAction(ctx context.Context, pluginID string, request resourcev2.ActionRequest) (string, error)
	AttachStreamAction(ctx context.Context, handleID string) (ActionSnapshot, error)
	CancelStreamAction(ctx context.Context, handleID string) error
}

Service is the typed native resource boundary. Wails uses explicit transport adapters; only host envelopes add row membership.

type ServiceWrapper added in v0.4.0

type ServiceWrapper struct {
	Ctrl  Controller
	Realm invocation.ContextScope
}

ServiceWrapper binds only admitted resource operations. Native lifecycle and graph reference validation are deliberately not frontend methods.

func (*ServiceWrapper) Action added in v0.12.0

func (s *ServiceWrapper) Action(ctx context.Context, pluginID string, encoded string) (resourcev2.Value, error)

func (*ServiceWrapper) AttachStreamAction added in v0.6.0

func (s *ServiceWrapper) AttachStreamAction(ctx context.Context, handleID string) (ActionSnapshot, error)

func (*ServiceWrapper) CancelStreamAction added in v0.6.0

func (s *ServiceWrapper) CancelStreamAction(ctx context.Context, handleID string) error

func (*ServiceWrapper) Catalog added in v0.12.0

func (s *ServiceWrapper) Catalog(ctx context.Context, pluginID string, request resourcev2.CatalogRequest) (resourcev2.Catalog, error)

func (*ServiceWrapper) CheckConnection added in v0.4.0

func (s *ServiceWrapper) CheckConnection(ctx context.Context, pluginID string, connectionID string) (types.ConnectionStatus, error)

func (*ServiceWrapper) CloseSourceView added in v0.24.0

func (s *ServiceWrapper) CloseSourceView(ctx context.Context, pluginID, viewID string) error

func (*ServiceWrapper) CompletePredicate added in v0.32.1

CompletePredicate is the authoring transport: one cancellable request per call, admitted, bounded and identity-checked by the host (omniview.authoring.v1).

func (*ServiceWrapper) Enumerate added in v0.12.0

func (s *ServiceWrapper) Enumerate(ctx context.Context, pluginID string, request HostEnumerateRequest) (HostSourcePage, error)

func (*ServiceWrapper) Features added in v0.12.0

func (s *ServiceWrapper) Features(ctx context.Context, pluginID string) (resourcev2.FeatureSet, error)

func (*ServiceWrapper) Get added in v0.4.0

func (s *ServiceWrapper) Get(ctx context.Context, pluginID string, request HostGetRequest) (HostRecord, error)

func (*ServiceWrapper) GetActions added in v0.4.0

func (s *ServiceWrapper) GetActions(ctx context.Context, pluginID string, route resourcev2.AccessRoute, resourceType string) ([]resourcev2.ActionDescriptor, error)

func (*ServiceWrapper) GetAllConnectionStates added in v0.4.0

func (s *ServiceWrapper) GetAllConnectionStates(ctx context.Context) (map[string][]ConnectionState, error)

func (*ServiceWrapper) GetConnection added in v0.4.0

func (s *ServiceWrapper) GetConnection(ctx context.Context, pluginID string, connectionID string) (types.Connection, error)

func (*ServiceWrapper) GetConnectionMetadata added in v0.13.0

func (s *ServiceWrapper) GetConnectionMetadata(ctx context.Context, pluginID, connectionID string) (HostConnectionMetadata, error)

func (*ServiceWrapper) GetEditorSchemaDocument added in v0.27.0

func (s *ServiceWrapper) GetEditorSchemaDocument(ctx context.Context, pluginID string, route resourcev2.AccessRoute, documentID string) (EditorSchemaDocument, error)

func (*ServiceWrapper) GetEditorSchemas added in v0.4.0

func (s *ServiceWrapper) GetEditorSchemas(ctx context.Context, pluginID string, route resourcev2.AccessRoute) ([]EditorSchemaAssociation, error)

func (*ServiceWrapper) GetHealth added in v0.4.0

func (s *ServiceWrapper) GetHealth(ctx context.Context, pluginID string, encoded string) (*resourcev2.ResourceHealth, error)

func (*ServiceWrapper) GetRelationships added in v0.4.0

func (s *ServiceWrapper) GetRelationships(ctx context.Context, pluginID string, route resourcev2.AccessRoute, resourceType string) ([]resourcev2.RelationshipDescriptor, error)

func (*ServiceWrapper) GetResourceDefinition added in v0.4.0

func (s *ServiceWrapper) GetResourceDefinition(ctx context.Context, pluginID string, route resourcev2.AccessRoute, resourceType string) (resourcev2.ResourceDefinition, error)

func (*ServiceWrapper) GetResourceEvents added in v0.4.0

func (s *ServiceWrapper) GetResourceEvents(ctx context.Context, pluginID string, request resourcev2.GetRequest, limit uint32) ([]resourcev2.ResourceEvent, error)

func (*ServiceWrapper) GetResourceGroups added in v0.4.0

func (s *ServiceWrapper) GetResourceGroups(ctx context.Context, pluginID string, route resourcev2.AccessRoute) ([]resourcev2.ResourceGroup, error)

func (*ServiceWrapper) GetSchemaDocument added in v0.12.0

func (*ServiceWrapper) GetSchemaFields added in v0.27.0

func (s *ServiceWrapper) GetSchemaFields(ctx context.Context, pluginID string, request SchemaFieldsRequest) (SchemaFieldsResult, error)

func (*ServiceWrapper) GetSourceStates added in v0.24.0

func (s *ServiceWrapper) GetSourceStates(ctx context.Context, pluginID string, route resourcev2.AccessRoute) (HostSourceStates, error)

func (*ServiceWrapper) HasPlugin added in v0.4.0

func (s *ServiceWrapper) HasPlugin(ctx context.Context, pluginID string) (bool, error)

func (*ServiceWrapper) ImportConnectionProfile added in v0.12.0

func (s *ServiceWrapper) ImportConnectionProfile(ctx context.Context, pluginID string, connectionID string) (ConnectionProfileResult, error)

func (*ServiceWrapper) ListAllConnections added in v0.4.0

func (s *ServiceWrapper) ListAllConnections(ctx context.Context) (map[string][]types.Connection, error)

func (*ServiceWrapper) ListConnectionProfiles added in v0.12.0

func (s *ServiceWrapper) ListConnectionProfiles(ctx context.Context, pluginID string) ([]ConnectionProfile, error)

func (*ServiceWrapper) ListConnections added in v0.4.0

func (s *ServiceWrapper) ListConnections(ctx context.Context, pluginID string) ([]types.Connection, error)

func (*ServiceWrapper) ListPlugins added in v0.4.0

func (s *ServiceWrapper) ListPlugins(ctx context.Context) ([]string, error)

func (*ServiceWrapper) LoadConnections added in v0.4.0

func (s *ServiceWrapper) LoadConnections(ctx context.Context, pluginID string) ([]types.Connection, error)

func (*ServiceWrapper) Mutate added in v0.12.0

func (s *ServiceWrapper) Mutate(ctx context.Context, pluginID string, encoded string) (resourcev2.Record, error)

func (*ServiceWrapper) NativeQuery added in v0.12.0

func (s *ServiceWrapper) NativeQuery(ctx context.Context, pluginID string, encoded string) (HostSourcePage, error)

func (*ServiceWrapper) OpenSourceView added in v0.24.0

func (s *ServiceWrapper) OpenSourceView(ctx context.Context, pluginID string, request HostSourceViewRequest) (HostSourceViewOpened, error)

func (*ServiceWrapper) RefreshConnectionMetadata added in v0.13.0

func (s *ServiceWrapper) RefreshConnectionMetadata(ctx context.Context, pluginID, connectionID string) (HostConnectionMetadata, error)

func (*ServiceWrapper) RefreshSourceView added in v0.24.0

func (s *ServiceWrapper) RefreshSourceView(ctx context.Context, pluginID, viewID string) error

func (*ServiceWrapper) RemoveConnection added in v0.4.0

func (s *ServiceWrapper) RemoveConnection(ctx context.Context, pluginID string, connectionID string) error

func (*ServiceWrapper) ResetConnectionProfile added in v0.12.0

func (s *ServiceWrapper) ResetConnectionProfile(ctx context.Context, pluginID string, connectionID string) (ConnectionProfileResult, error)

func (*ServiceWrapper) ResolveReference added in v0.12.0

func (s *ServiceWrapper) ResolveReference(ctx context.Context, pluginID string, request ResolveReferenceRequest) (ResolvedReference, error)

func (*ServiceWrapper) ResolveRelationships added in v0.4.0

func (s *ServiceWrapper) ResolveRelationships(ctx context.Context, pluginID string, request resourcev2.GetRequest) ([]resourcev2.ResolvedRelationship, error)

func (*ServiceWrapper) ResolveTarget added in v0.12.0

func (s *ServiceWrapper) ResolveTarget(ctx context.Context, pluginID string, request ResolveTargetRequest) (ResolvedTarget, error)

func (*ServiceWrapper) RetryConnectionSources added in v0.24.0

func (s *ServiceWrapper) RetryConnectionSources(ctx context.Context, pluginID string, route resourcev2.AccessRoute) error

func (*ServiceWrapper) SaveConnectionProfile added in v0.12.0

func (s *ServiceWrapper) SaveConnectionProfile(ctx context.Context, pluginID string, encoded string, credentials *ConnectionProfileCredentials) (ConnectionProfileResult, error)

func (*ServiceWrapper) ScopeValues added in v0.12.0

func (s *ServiceWrapper) ScopeValues(ctx context.Context, pluginID string, route resourcev2.AccessRoute, dimension string) ([]string, error)

func (*ServiceWrapper) ServiceShutdown added in v0.4.0

func (s *ServiceWrapper) ServiceShutdown() error

func (*ServiceWrapper) ServiceStartup added in v0.4.0

func (s *ServiceWrapper) ServiceStartup(ctx context.Context, options application.ServiceOptions) error

func (*ServiceWrapper) StartConnection added in v0.4.0

func (s *ServiceWrapper) StartConnection(ctx context.Context, pluginID string, connectionID string) (types.ConnectionStatus, error)

func (*ServiceWrapper) StopConnection added in v0.4.0

func (s *ServiceWrapper) StopConnection(ctx context.Context, pluginID string, connectionID string) (types.Connection, error)

func (*ServiceWrapper) StreamAction added in v0.4.0

func (s *ServiceWrapper) StreamAction(ctx context.Context, pluginID string, encoded string) (string, error)

func (*ServiceWrapper) SyncSourceView added in v0.24.0

func (s *ServiceWrapper) SyncSourceView(ctx context.Context, pluginID, viewID string) error

type SourcePageMetadata added in v0.12.0

type SourcePageMetadata struct {
	NextCursor     *string             `json:"nextCursor,omitempty"`
	Count          resourcev2.Count    `json:"count"`
	Coverage       resourcev2.Coverage `json:"coverage"`
	Consistency    string              `json:"consistency"`
	SourceRevision *string             `json:"sourceRevision,omitempty"`
}

Directories

Path Synopsis
Package leasewire implements bounded result-lease delivery independently of execution and the Wails transport.
Package leasewire implements bounded result-lease delivery independently of execution and the Wails transport.

Jump to

Keyboard shortcuts

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