common

package
v0.3.6-alpha4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

The commmon package provides structs and functions for external code to interact with this gateway service.

Index

Constants

View Source
const (
	ConfigKeyLogPath     = "gateway.LogPath"
	ConfigKeyLogSaveName = "gateway.LogSaveName"
	ConfigKeyLogFileExt  = "gateway.LogFileExt"
	ConfigKeyGatewayPort = "gateway.Port"
	ConfigKeyWWWPath     = "gateway.WWWPath"
	ConfigKeyRuntimePath = "common.RuntimePath"

	DefaultGatewayPort = "80"
)
View Source
const (
	ManagementURLFilename = "management.url"
	StaticURLFilename     = "static.url"
	APIGatewayRoutes      = "/v1/gateway/routes"
	APIGatewayPort        = "/v1/gateway/port"
)
View Source
const Version = "0.3.6"

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig() (*viper.Viper, error)

Types

type ChangePortRequest

type ChangePortRequest struct {
	Port string `json:"port" binding:"required"`
}

type ManagementService

type ManagementService interface {
	CreateRoute(route *Route) error
	ChangePort(request *ChangePortRequest) error
}

func NewManagementService

func NewManagementService(RuntimePath string) (ManagementService, error)

type Route

type Route struct {
	Path   string `json:"path" binding:"required"`
	Target string `json:"target" binding:"required"`
}

Jump to

Keyboard shortcuts

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