server

package
v0.0.0-...-61a96ab Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APICommonPrefix is a restful API prefix.
	APICommonPrefix = "/api"
)
View Source
const (
	// APIPrefix is a base path to restful APIs.
	APIPrefix = APICommonPrefix + "/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Router) error

Option stands for functional parameter

func WithController

func WithController(wc *controller.Controller) Option

WithController is an functional parameter to use a controller.

func WithGithubWebhook

func WithGithubWebhook(secret string) Option

WithGithubWebhook is a functional parameter to use a github webhook secret.

func WithVersion

func WithVersion(version interface{}) Option

WithVersion sets the version object. This will be used for health endpoint.

type Router

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

Router is an abstraction over mux.Router

func New

func New(cfg *config.Config, opts ...Option) (*Router, error)

New creates a new instance of a Rounter

func (*Router) Start

func (r *Router) Start() error

Start a new HTTP server

Jump to

Keyboard shortcuts

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