cmd

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: BSD-3-Clause Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const Version = version.Vers

Variables

View Source
var Root = &cobra.Command{
	Use: "go-hub <command>",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		fmt.Printf("Version:\t%s\nGo runtime:\t%s\n\n",
			Version, runtime.Version(),
		)
	},
}

Functions

func CertTemplate

func CertTemplate() (*x509.Certificate, error)

helper function to create a cert template with a serial number and other required fields

func CloseDB added in v0.20.0

func CloseDB() error

func CreateCert

func CreateCert(template, parent *x509.Certificate, pub interface{}, parentPriv interface{}) (
	cert *x509.Certificate, certPEM []byte, err error)

func OpenDB added in v0.20.0

func OpenDB() error

Types

type Config

type Config struct {
	Name    string `yaml:"name"`
	Desc    string `yaml:"desc"`
	Owner   string `yaml:"owner"`
	Website string `yaml:"website"`
	Email   string `yaml:"email"`
	MOTD    string `yaml:"motd"`
	Private bool   `yaml:"private"`
	Serve   struct {
		Host string     `yaml:"host"`
		Port int        `yaml:"port"`
		TLS  *TLSConfig `yaml:"tls"`
	} `yaml:"serve"`
	Chat struct {
		Encoding string `yaml:"encoding"`
		Log      struct {
			Max  int `yaml:"max"`
			Join int `yaml:"join"`
		}
	} `yaml:"chat"`
	Database struct {
		Type string `yaml:"type"`
		Path string `yaml:"path"`
	} `yaml:"database"`
	Plugins struct {
		Path string `yaml:"path"`
	} `yaml:"plugins"`
}

type TLSConfig

type TLSConfig struct {
	Cert string `yaml:"cert"`
	Key  string `yaml:"key"`
}

func (*TLSConfig) Generate

func (c *TLSConfig) Generate(host string) (cert, key []byte, _ error)

func (*TLSConfig) Load

func (c *TLSConfig) Load() (cert, key []byte, _ error)

Jump to

Keyboard shortcuts

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