config

package
v0.0.0-...-924e1ad Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2014 License: MIT, MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(writer io.Writer, conf *ConfigFile) (err error)

Types

type Channel

type Channel struct {
	Name string `json:"-"`
}

func NewChannel

func NewChannel() *Channel

type Config

type Config struct {
	Servers map[string]*Server
}

func Parse

func Parse(reader io.Reader) (*Config, error)

type ConfigFile

type ConfigFile struct {
	Servers  map[string]*Server  `json:"servers"`
	Channels map[string]*Channel `json:"channels"`
	HTTP     *HTTP               `json:"http"`
}

func New

func New() *ConfigFile

func Read

func Read(reader io.Reader) (conf *ConfigFile, err error)

func (*ConfigFile) Parse

func (conf *ConfigFile) Parse() *Config

func (*ConfigFile) String

func (conf *ConfigFile) String() string

type Connection

type Connection struct {
	Address     string `json:"address"`
	Bind        string `json:"bind"`
	SSL         bool   `json:"ssl"`
	Certificate bool   `json:"certificate"`
}

type HTTP

type HTTP struct {
	Bind string `json:"bind"`
}

type Login

type Login struct {
	User     string    `json:"user"`
	Password string    `json:"password"`
	Name     string    `json:"name"`
	Ident    string    `json:"ident"`
	NickServ *NickServ `json:"nickserv"`
}

type Messages

type Messages struct {
	Version string `json:"version"`
	Quit    string `json:"quit"`
}

type NickServ

type NickServ struct {
	User     string `json:"name"`
	Password string `json:"password"`
}

type Server

type Server struct {
	Name       string              `json:"-"`
	Connection *Connection         `json:"connection"`
	Login      *Login              `json:"login"`
	Messages   *Messages           `json:"messages"`
	Channels   map[string]*Channel `json:"-"`
}

func NewServer

func NewServer(name string) *Server

Jump to

Keyboard shortcuts

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