openresty

package
Version: v3.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: LGPL-3.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GET    = "GET"
	POST   = "POST"
	UPDATE = "UPDATE"
	DELETE = "DELETE"
)

Variables

This section is empty.

Functions

func Check

func Check(ctx plugin.Context) error

Check check openresty plugin optins

func New

func New(ctx plugin.Context) (plugin.Plugin, error)

create entrance plugin for openresty

Types

type NginxInstance

type NginxInstance struct {
	Addr                 string // 10.10.10.11:8081
	State                string // health/unhealth/dead
	HeartbeatLast        int64  // time.Now().Unix()
	GetHeartbeatInterval int64  // 3s
	HeartbeatTimeOut     int64  // 30s
	TimeOutExprie        int64  // 90s
}

type NginxNode

type NginxNode struct {
	State string `json:"state"` // Active/Draining/Disabled

	// 每个server是IP加端口的形,后面可以加nginx兼容的选项
	// 10.10.10.11:8080 weight=5 service=http resolve
	Addr   string `json:"addr"`
	Weight int    `json:"weight"`
}

type NginxServer

type NginxServer struct {
	Name     string            `json:"name"`
	Domain   string            `json:"domain"`
	Port     int32             `json:"port"`
	Path     string            `json:"path"`
	Protocol string            `json:"protocol"` // http and https only
	Cert     string            `json:"cert"`
	Key      string            `json:"key"`
	Options  map[string]string `json:"options"`
	Upstream string            `json:"upstream"`
	ToHTTPS  bool              `json:"toHTTPS"`
}

type NginxUpstream

type NginxUpstream struct {
	Name     string      `json:"name"`
	Servers  []NginxNode `json:"servers"`
	Protocol string      `json:"protocol"`
}

func (*NginxUpstream) AddNode

func (u *NginxUpstream) AddNode(node NginxNode)

type Options

type Options struct {
	Protocol string `json:"protocol"` // http/https/tcp/udp
}

Jump to

Keyboard shortcuts

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