api

package
v0.0.0-...-3361740 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package api contains the REST and gRPC API.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	UrlServiceName = "UrlService"
)

Variables

View Source
var (
	Services = []string{}
)

Functions

func ServeStaticFile

func ServeStaticFile(mux *http.ServeMux)

ServeStaticFile expose static files

func ServeSwagger

func ServeSwagger(mux *http.ServeMux)

ServeSwagger expose files in third_party/swagger-ui/ on <host>/swagger-ui

func VersionHandler

func VersionHandler(w http.ResponseWriter, r *http.Request)

Types

type HealthService

type HealthService struct {
	Authentication auth.Authentication
	HealthUser     string
	HealthKey      string
	URI            string
	Services       []string
}

func NewHealthService

func NewHealthService(conf *config.Configuration, uri string, services []string) (*HealthService, error)

func (*HealthService) Status

type InfoService

type InfoService struct {
	Version string
}

func NewInfoService

func NewInfoService(conf *config.Configuration) *InfoService

func (*InfoService) Get

type Service

type Service interface {
	// Register
	Register()
}

type UrlService

type UrlService struct {
	Storage storage.Storage
}

func NewUrlService

func NewUrlService(storage storage.Storage) *UrlService

func (*UrlService) Create

func (*UrlService) Get

func (*UrlService) List

func (*UrlService) Register

func (service *UrlService) Register()

type VersionResponse

type VersionResponse struct {
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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