napodate

package module
v0.0.0-...-812c43b Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 8 Imported by: 0

README

Go kit: a little microservice example

A little "RESTful" Go kit microservice I built to learn a bit more about Go kit

Read more @ coding.napolux.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeGetEndpoint

func MakeGetEndpoint(srv Service) endpoint.Endpoint

MakeGetEndpoint returns the response from our service "get"

func MakeStatusEndpoint

func MakeStatusEndpoint(srv Service) endpoint.Endpoint

MakeStatusEndpoint returns the response from our service "status"

func MakeValidateEndpoint

func MakeValidateEndpoint(srv Service) endpoint.Endpoint

MakeValidateEndpoint returns the response from our service "validate"

func NewHTTPServer

func NewHTTPServer(ctx context.Context, endpoints Endpoints) http.Handler

NewHTTPServer is a good little server

Types

type Endpoints

type Endpoints struct {
	GetEndpoint      endpoint.Endpoint
	StatusEndpoint   endpoint.Endpoint
	ValidateEndpoint endpoint.Endpoint
}

Endpoints are exposed

func (Endpoints) Get

func (e Endpoints) Get(ctx context.Context) (string, error)

Get endpoint mapping

func (Endpoints) Status

func (e Endpoints) Status(ctx context.Context) (string, error)

Status endpoint mapping

func (Endpoints) Validate

func (e Endpoints) Validate(ctx context.Context, date string) (bool, error)

Validate endpoint mapping

type Service

type Service interface {
	Status(ctx context.Context) (string, error)
	Get(ctx context.Context) (string, error)
	Validate(ctx context.Context, date string) (bool, error)
}

Service provides some "date capabilities" to your application

func NewService

func NewService() Service

NewService makes a new Service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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