config

package
v0.0.0-...-15ca262 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Root

type Root struct {
	ListenAddr string `json:"listen_addr"`
	Twisms     Twisms `json:"twisms"`
	Twicmd     Twicmd `json:"twicmd"`
}

Root is the root configuration for the twid package.

type Twicmd

type Twicmd struct {
	Parsers  []TwicmdParser  `json:"parsers"`
	Services []TwicmdService `json:"services"`
}

type TwicmdParser

type TwicmdParser struct {
	Module string `json:"module"`
	// contains filtered or unexported fields
}

TwicmdParser is the configuration for a Twicmd parser.

func (*TwicmdParser) MarshalJSON

func (t *TwicmdParser) MarshalJSON() ([]byte, error)

func (*TwicmdParser) UnmarshalJSON

func (t *TwicmdParser) UnmarshalJSON(b []byte) error

type TwicmdService

type TwicmdService struct {
	// Module is the name of the Twicmd module to use for this service.
	Module string `json:"module"`
	// contains filtered or unexported fields
}

TwicmdService is the configuration for a Twicmd service.

func (*TwicmdService) MarshalJSON

func (t *TwicmdService) MarshalJSON() ([]byte, error)

func (*TwicmdService) UnmarshalJSON

func (t *TwicmdService) UnmarshalJSON(b []byte) error

type Twisms

type Twisms struct {
	Services []TwismsService `json:"services"`
}

Twisms is the configuration for package Twisms.

type TwismsService

type TwismsService struct {
	// Module is the name of the Twisms module.
	// It must be registered with [twid.RegisterTwismsModule].
	Module string `json:"module"`
	// HTTPPath is the path that the HTTP handler will be mounted on.
	// If empty, the service will not get routed, even if it provides an HTTP
	// handler.
	HTTPPath string `json:"http_path,omitempty"`
	// contains filtered or unexported fields
}

TwismsService is the configuration for a Twisms service. The user must specify the module name and the configuration for that module in the same JSON object.

func (*TwismsService) MarshalJSON

func (t *TwismsService) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It never fails.

func (*TwismsService) UnmarshalJSON

func (t *TwismsService) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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