services

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: ISC Imports: 2 Imported by: 4

Documentation

Overview

Package services provides a global repository of cchat services. It also supports additional sources.

Registering services

To register a service, it's best to call RegisterService() in the package's init(). This allows for dash imports:

_ "git.sr.ht/~user/cchat-abc"

Registering sources

Sources are simply functions that manage other services. An example of this would be the plugins package. Note that only packages that can error out on load should do this. A package can call RegisterService() multiple times.

For examples on using RegisterSource(), check the plugins package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() ([]cchat.Service, []error)

Get returns all services. It will also fetch the plugins from all sources. Future calls will not fetch the plugins again.

func RegisterService

func RegisterService(service ...cchat.Service)

RegisterService adds a service.

func RegisterSource

func RegisterSource(source func() []error)

RegisterSource adds a service source. Services are expected to call RegisterService() on source().

Types

This section is empty.

Directories

Path Synopsis
Package plugins provides a source for cchat services as Go plugins.
Package plugins provides a source for cchat services as Go plugins.

Jump to

Keyboard shortcuts

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