restserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package restserver implements a pluggable library for REST servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	InsecureServing InsecureServingConfig
	Mode            string
	Middlewares     []string
	UseHealthz      bool
}

Config holds configs for REST server.

type InsecureServingConfig

type InsecureServingConfig struct {
	Host string
	Port int
}

InsecureServingConfig holds insecure serving configs for REST server.

func (*InsecureServingConfig) Addr

func (c *InsecureServingConfig) Addr() string

Addr returns the full address(host:port).

type RESTServer

type RESTServer interface {
	Start() error
	Stop() error
}

RESTServer defines the interface of a REST server.

func New

func New(cfg *Config, serviceRouter service.Router) RESTServer

New returns the concrete value of interface RESTServer.

Directories

Path Synopsis
controller
v1/timer
Package timer provides an interface of HTTP controller for RESTful resource Timer as well as an implementation.
Package timer provides an interface of HTTP controller for RESTful resource Timer as well as an implementation.
Package middleware provides middlewares for REST server.
Package middleware provides middlewares for REST server.
Package response provides a uniformed interface for writing HTTP responses.
Package response provides a uniformed interface for writing HTTP responses.

Jump to

Keyboard shortcuts

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