proxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WarningColor yellow color
	WarningColor = "\033[1;33m%s\033[0m"

	// ErrorColor red color
	ErrorColor = "\033[1;31m%s\033[0m"
)

Variables

View Source
var Services []Service

Services define all services that connect to gateway

Functions

func AddPlugin

func AddPlugin(serviceName string, pluginName string, config map[string]interface{}) (string, bool)

AddPlugin api for add plugin to proxy

func CheckServices

func CheckServices(then bool)

CheckServices function for check if service is available or not params: then : mean that function call at start or later in health

func HealthCheck

func HealthCheck()

HealthCheck function for check all services per hour in goroutine

func LoadServices

func LoadServices(jsonData bool)

LoadServices function for loading services from json file

func RemovePlugin

func RemovePlugin(serviceName string, pluginName string) (string, bool)

RemovePlugin from proxy

func SyncPlugins

func SyncPlugins(proxyName string)

SyncPlugins after load from db, sync functions to struct cause method address after app execution not meaning anything

Types

type Server

type Server struct {
	Server string
	Up     bool
}

Server define services active servers

type Service

type Service struct {
	Name        string
	Path        string
	Server      []Server
	Version     int
	Description string
	Urls        []URL
	Plugins     []plugins.Plugin
}

Service define structure of service loaded to this gateway

type URL

type URL struct {
	Method string
	Path   string
}

URL define routes of services

Jump to

Keyboard shortcuts

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