glas

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

Glas

goreportcard

Telnet based MUD client framework. User-facing implementations can be found in the cmd package.

Issues and pull requests are welcome.

License

Copyright 2018 Nathan "IngCr3at1on" Bass

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNilConfig is returned if the provided config is nil.
	ErrNilConfig = errors.New("config cannot be nil")
	// ErrNilInput is returned if the config.Input value is nil.
	ErrNilInput = errors.New("config.Input cannot be nil")
	// ErrNilOutput is returned if the config.Output value is nil.
	ErrNilOutput = errors.New("config.Output cannot be nil")
	// ErrNilContext is returned if the ctx provided to start is nil.
	ErrNilContext = errors.New("ctx cannot be nil")
	// ErrNilCancelF is returned if the cancel function provided to start is nil.
	ErrNilCancelF = errors.New("cancel cannot be nil")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Input is an input io.Reader (os.Stdin for example).
	Input io.Reader
	// Output is an output io.Writer (os.Stdout for example).
	Output io.Writer
	// CmdPrefix is the prefix used for client commands, by default this
	// is `/`.
	CmdPrefix string
}

Config houses non-character configuration options.

func (*Config) Validate

func (c *Config) Validate() error

Validate a configuration, error if a required value is missing and set defaults (if a value is not provided) when not required.

type Glas

type Glas struct {
	// contains filtered or unexported fields
}

Glas is a mud client backend.

func New

func New(config *Config) (*Glas, error)

New returns a new instance of Glas.

func (*Glas) Start

func (g *Glas) Start(ctx context.Context, cancel context.CancelFunc) error

Start the Glas client.

Directories

Path Synopsis
cmd
cli

Jump to

Keyboard shortcuts

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