rest

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(m MatcherService)

Run creates and runs the HTTP API service of gnmatcher.

Types

type MatcherREST

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

MatchMatcherREST implements MatcherService interface.

func NewMatcherREST

func NewMatcherREST(gnm *gnmatcher.GNMatcher, port int, enc encode.Encoder) MatcherREST

NewMNewMatcherREST is a constructor for MatchREST.

func (MatcherREST) Decode added in v0.3.3

func (mr MatcherREST) Decode(input []byte, output interface{}) error

Decode decodes an object from a bytes slice.

func (MatcherREST) Encode added in v0.3.3

func (mr MatcherREST) Encode(obj interface{}) ([]byte, error)

Encode encodes an object into a byte slice.

func (MatcherREST) MatchAry

func (mr MatcherREST) MatchAry(names []string) []*entity.Match

MatchAry takes a list of strings and matches them to known scientific names.

func (MatcherREST) Ping

func (mr MatcherREST) Ping() string

Ping returns "pong" message if connection to the service did succed.

func (MatcherREST) Port added in v0.3.3

func (mr MatcherREST) Port() int

GetPort returns port number to the service.

func (MatcherREST) Version added in v0.3.3

func (mr MatcherREST) Version() entity.Version

GetVersion returns version number and build timestamp of gnmatcher.

type MatcherService added in v0.3.3

type MatcherService interface {
	// Port returns the port of the service.
	Port() int

	// Ping checks connection to the service.
	Ping() string

	usecase.Matcher

	encode.Encoder
}

MatcherService describes remote service of gnmatchter.

Jump to

Keyboard shortcuts

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