owljsonrpc

package
v0.0.0-...-1704659 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(ctx context.Context, target interface{}, method string, reqData json.RawMessage) (interface{}, error)

Call looks for a method on target, and then unmarshals reqData into something that looks like its input

Valid method signatures: - (a *A) func(ctx context.Context) error - (a *A) func(ctx context.Context, req *X) error - (a *A) func(ctx context.Context) (*Y, error) - (a *A) func(ctx context.Context, req *X) (*Y, error)

- The method can have 1 or 2 output values, and the last one must be an error - The method can have 2 or 3 input values--including the receiver. - The first input is the receiver, the second is a context.

func ServeRWC

func ServeRWC(ctx context.Context, rwc io.ReadWriteCloser, o owl.API) error

ServeRWC serves requests over an io.ReadWriteCloser rwc, using that Owl API o.

Types

type Client

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

func NewClient

func NewClient(rwc io.ReadWriteCloser) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) CreateChannel

func (c *Client) CreateChannel(ctx context.Context, req *owl.CreateChannelReq) error

CreateChannel creates a new channel with name

func (*Client) CreateContact

func (c *Client) CreateContact(ctx context.Context, req *owl.CreateContactReq) error

CreateContact adds a contact to the contact list for persona

func (*Client) CreatePersona

func (c *Client) CreatePersona(ctx context.Context, req *owl.CreatePersonaReq) error

CreatePersona creates a new persona called name. If any ids are provided then the persona will not have a feed, and will attempt to join a feed provided by one of the IDs.

func (*Client) DeleteChannel

func (c *Client) DeleteChannel(ctx context.Context, cid *owl.ChannelID) error

DeleteChannel deletes the channel with name if it exists

func (*Client) DeleteContact

func (c *Client) DeleteContact(ctx context.Context, req *owl.DeleteContactReq) error

RemoveContact removes a contact.

func (*Client) DropPersona

func (c *Client) DropPersona(ctx context.Context, req string) error

DropPersona implements owl.DropPersona

func (*Client) ExpandPersona

func (c *Client) ExpandPersona(ctx context.Context, req *owl.ExpandPersonaReq) error

ExpandPersona adds a peer to the Persona at name.

func (*Client) GetChannel

func (c *Client) GetChannel(ctx context.Context, cid *owl.ChannelID) (*owl.ChannelInfo, error)

GetLatest returns the latest EntryIndex

func (*Client) GetContact

func (c *Client) GetContact(ctx context.Context, req *owl.GetContactReq) (*owl.Contact, error)

GetContact returns information about a contact.

func (*Client) GetPersona

func (c *Client) GetPersona(ctx context.Context, req *owl.GetPersonaReq) (*owl.Persona, error)

GetPersona retrieves the Persona at name

func (*Client) JoinChannel

func (c *Client) JoinChannel(ctx context.Context, req *owl.JoinChannelReq) error

JoinChannel joins an existing channel

func (*Client) ListChannels

func (c *Client) ListChannels(ctx context.Context, req *owl.ListChannelReq) ([]string, error)

ListChannels lists channels starting with begin

func (*Client) ListContact

func (c *Client) ListContact(ctx context.Context, req *owl.ListContactReq) ([]string, error)

ListContacts lists contacts starting with begin.

func (*Client) ListPersonas

func (c *Client) ListPersonas(ctx context.Context) ([]string, error)

ListPersonas lists personas on the instance.

func (*Client) Read

func (c *Client) Read(ctx context.Context, req *owl.ReadReq) ([]owl.Entry, error)

Read reads events from a channel

func (*Client) Send

func (c *Client) Send(ctx context.Context, req *owl.SendReq) error

Send, sends a message to a channel.

func (*Client) ShrinkPersona

func (c *Client) ShrinkPersona(ctx context.Context, req *owl.ShrinkPersonaReq) error

ShrinkPersona removes a peer from the Persona at name

func (*Client) Sync

func (c *Client) Sync(ctx context.Context, req *owl.SyncReq) error

func (*Client) Wait

func (c *Client) Wait(ctx context.Context, req *owl.WaitReq) (*owl.WaitRes, error)

Jump to

Keyboard shortcuts

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