infrastructure

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd interface {
	io.Writer
	Start() error
	Wait(timeout time.Duration) error
	Scanner() *bufio.Scanner
	Chdir(dir string)
}

Cmd is simple interface of exec.Cmd.

func NewCmd

func NewCmd(path string) Cmd

NewCmd returns new Cmd.

type Connector

type Connector interface {
	Connect() error
	Close(timeout time.Duration) error
	OnReceive(func([]byte) bool) // if true, continue receiving
	UnsetOnReceive()
	Writer() io.Writer
}

Connector is a communicator with shogi engine service and os cmd.

func NewConnector

func NewConnector(cmd Cmd, logger logger.Logger) Connector

NewConnector returns new Connector.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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