service

package module
v0.0.0-...-f9573de Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2017 License: MIT Imports: 7 Imported by: 0

README

service.go

A microservice framework for Go.

  • Web
  • API
  • Pub/sub
  • Log
  • service.yml

See examples/ for sample implementations.

Warning
  • not production ready
  • no stable API - interfaces etc may change
Licence

Copyright ©‎ 2016, Ian Kent (http://www.iankent.eu).

Released under MIT license, see LICENSE for details.

Documentation

Index

Constants

This section is empty.

Variables

DefaultMiddleware is the default middleware used to create a service

Functions

This section is empty.

Types

type APIConfig

type APIConfig interface {
	HTTPConfig
}

APIConfig represents the configuration required for an API service

type Config

type Config interface {
	Namespace() string
}

Config represents the configuration required for a service

type DefaultAPIConfig

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

DefaultAPIConfig is a default APIConfig implementation

func (DefaultAPIConfig) BindAddr

func (c DefaultAPIConfig) BindAddr() string

BindAddr implements HTTPConfig.BindAddr

func (DefaultAPIConfig) CertFile

func (c DefaultAPIConfig) CertFile() string

CertFile implements HTTPConfig.CertFile

func (DefaultAPIConfig) KeyFile

func (c DefaultAPIConfig) KeyFile() string

KeyFile implements HTTPConfig.KeyFile

type DefaultWebConfig

type DefaultWebConfig struct {
	SessionSecret string `env:"SESSION_SECRET" flag:"session-secret" flagDesc:"Session secret"`
	SessionName   string `env:"SESSION_NAME" flag:"session-name" flagDesc:"Session name"`
	// contains filtered or unexported fields
}

DefaultWebConfig is a default WebConfig implementation

func (DefaultWebConfig) BindAddr

func (c DefaultWebConfig) BindAddr() string

BindAddr implements HTTPConfig.BindAddr

func (DefaultWebConfig) CertFile

func (c DefaultWebConfig) CertFile() string

CertFile implements HTTPConfig.CertFile

func (DefaultWebConfig) KeyFile

func (c DefaultWebConfig) KeyFile() string

KeyFile implements HTTPConfig.KeyFile

type HTTPConfig

type HTTPConfig interface {
	Config
	BindAddr() string
	CertFile() string
	KeyFile() string
}

HTTPConfig represents the configuration required for a HTTP service

type Service

type Service interface {
	Chain(handler ...alice.Constructor)
	Start()
	Router() *pat.Router
}

Service represents a service

func API

func API(config APIConfig) Service

API returns a new API service using the provided config

func HTTP

func HTTP(config HTTPConfig) Service

HTTP returns a new HTTP service using the provided config

func Web

func Web(config WebConfig) Service

Web returns a new web service using the provided config

type WebConfig

type WebConfig interface {
	HTTPConfig
}

WebConfig represents the configuration required for a web service

Directories

Path Synopsis
examples
api
web
handlers
def
web

Jump to

Keyboard shortcuts

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