nopaste

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2015 License: MIT Imports: 16 Imported by: 0

README

nopaste

nopaste http server & IRC agent.

Install

$ go get github.com/kayac/nopaste/cmd/nopaste

Usage

$ nopaste -config config.yaml

nopaste will rewrite the config.yaml(irc.channels section) when join to a new IRC channel.

Configuration

base_url: http://example.com  # for IRC messages
listen: "localhost:3000"
data_dir: data
irc:
  host: localhost
  port: 6666
  secure: false
  password: secret
  nick: npbot
  channels:
  - '#general'
  - '#infra'

nopaste runs http server on http://#{listen}/np.

LICENCE

The MIT License (MIT)

Documentation

Index

Constants

View Source
const MsgrRoot = "/irc-msgr"
View Source
const Root = "/np"

Variables

This section is empty.

Functions

func NewSNS added in v0.0.3

func NewSNS() *sns.SNS

func Run

func Run(configFile string) error

func RunIRCAgent

func RunIRCAgent(c *Config, ch chan IRCMessage)

func RunMsgr

func RunMsgr(configFile string) error

Types

type Config

type Config struct {
	BaseURL string    `yaml:"base_url"`
	Listen  string    `yaml:"listen"`
	DataDir string    `yaml:"data_dir"`
	IRC     IRCConfig `yaml:"irc"`
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(file string) (*Config, error)

func (*Config) AddChannel

func (c *Config) AddChannel(channel string)

func (*Config) DataFilePath

func (c *Config) DataFilePath(id string) string

func (*Config) Save

func (c *Config) Save() error

func (*Config) SetFilePath

func (c *Config) SetFilePath(path string)

type IRCConfig

type IRCConfig struct {
	Host     string   `yaml:"host"`
	Port     int      `yaml:"port"`
	Secure   bool     `yaml:"secure"`
	Debug    bool     `yaml:"debug"`
	Password string   `yaml:"password"`
	Nick     string   `yaml:"nick"`
	Channels []string `yaml:"channels"`
}

type IRCMessage

type IRCMessage struct {
	Channel string
	Notice  bool
	Text    string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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