web

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(gnps GNParserService)

Run starts the GNParser web service and servies both RESTful API and a website.

Types

type Data

type Data struct {
	Input    string
	Parsed   []string
	HomePage bool
	Version  string
}

Data contains information required to render web-pages.

func NewData

func NewData() *Data

NewData creates new Data for web-page templates.

type GNParserService

type GNParserService interface {
	gnparser.GNParser
	// Ping is a method to check if the service is running. Returns "pong".
	Ping() string
	// Port returns the port of the service.
	Port() int
}

GNParserService is an interface that provides functionality for GNParser RESTful service.

func NewGNParserService

func NewGNParserService(gnp gnparser.GNParser, port int) GNParserService

NewGNParserService creates a new object that implements GNParserService interface.

Jump to

Keyboard shortcuts

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