app

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package app implements the challenge's API There is two methods available:

- GET /api/ping

- POST /api/log

What package actually exports is the App struct throgh the New method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App will hold server description and contains the execution

func New

func New(network, port, filePath, difficulty string) (*App, error)

New creates the App instance with config params:

- network: 127.0.0.1, 0.0.0.0, etc

- port: port api will be exposed

- filePath: file to be used for csv chained logger

- difficulty: string used as hash begining ("00", for example)

func (*App) Run

func (a *App) Run(sig chan os.Signal) (done chan error)

Run starts the app. Sig chan is to send the stop in order to perform a clean closing. Returned done chan will be used to communicate the end of the execution, with its corresponding error, if happend (nil for none)

Jump to

Keyboard shortcuts

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