resources

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides client-side resource functionality

func NewClient

func NewClient(base *base.Base) *Client

NewClient creates a new Client

func (*Client) List

func (c *Client) List(ctx context.Context) ([]types.Resource, error)

List requests the list of available resources

func (*Client) ListTemplates

func (c *Client) ListTemplates(ctx context.Context) ([]types.ResourceTemplate, error)

ListTemplates requests the list of available resource templates

func (*Client) OnResourceListChanged

func (c *Client) OnResourceListChanged(callback func())

OnResourceListChanged registers a callback for resource list change notifications

func (*Client) OnResourceUpdated

func (c *Client) OnResourceUpdated(callback func(uri string))

OnResourceUpdated registers a callback for resource update notifications

func (*Client) Read

func (c *Client) Read(ctx context.Context, uri string) ([]types.ResourceContent, error)

Read requests the contents of a specific resource

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context, uri string) error

Subscribe subscribes to updates for a specific resource

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(ctx context.Context, uri string) error

Unsubscribe unsubscribes from updates for a specific resource

Jump to

Keyboard shortcuts

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