varys

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package varys is an abstraction that allows you to add or remove puppets, and receive a snapshot of state via an RPC-based interface.

Why "varys"? Because it is the Master of Whisperers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer()

Types

type Client

type Client interface {
	Setup(params SetupParams) error
	GetUIDToNicks() (map[string]string, error)
	Connect(params ConnectParams) error // Does not yet support netClient
	QuitIfConnected(uid string, quitMsg string) error
	Nick(uid string, nick string) error

	// SendRaw supports a blank uid to send to all connections.
	SendRaw(uid string, params InterpolationParams, messages ...string) error
	// GetNick gets the current connection's nick
	GetNick(uid string) (string, error)
	// Connected returns the status of the current connection
	Connected(uid string) (bool, error)
}

func NewMemClient

func NewMemClient() Client

NewMemClient returns an in-memory variant of varys

func NewNetClient

func NewNetClient() Client

type ConnectParams

type ConnectParams struct {
	UID string

	Nick     string
	Username string
	RealName string

	WebIRCSuffix string

	// TODO(qaisjp): does not support net/rpc!!!!
	Callbacks map[string]func(*irc.Event)
}

type InterpolationParams

type InterpolationParams struct {
	Nick bool
}

type NickParams

type NickParams struct {
	UID  string
	Nick string
}

type QuitParams

type QuitParams struct {
	UID         string
	QuitMessage string
}

type SendRawParams

type SendRawParams struct {
	UID      string
	Messages []string

	Interpolation InterpolationParams
}

type SetupParams

type SetupParams struct {
	UseTLS             bool // Whether we should use TLS
	InsecureSkipVerify bool // Controls tls.Config.InsecureSkipVerify, if using TLS

	Server         string
	ServerPassword string
	WebIRCPassword string
}

type Varys

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

func NewVarys

func NewVarys() *Varys

func (*Varys) Connect

func (v *Varys) Connect(params ConnectParams, _ *struct{}) error

func (*Varys) Connected

func (v *Varys) Connected(uid string, result *bool) error

func (*Varys) GetNick

func (v *Varys) GetNick(uid string, result *string) error

func (*Varys) GetUIDToNicks

func (v *Varys) GetUIDToNicks(_ struct{}, result *map[string]string) error

func (*Varys) Nick

func (v *Varys) Nick(params NickParams, _ *struct{}) error

func (*Varys) QuitIfConnected

func (v *Varys) QuitIfConnected(params QuitParams, _ *struct{}) error

func (*Varys) SendRaw

func (v *Varys) SendRaw(params SendRawParams, _ *struct{}) error

func (*Varys) Setup

func (v *Varys) Setup(params SetupParams, _ *struct{}) error

Jump to

Keyboard shortcuts

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