internal

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func E

func E(msg string, args ...interface{}) error

func GetName

func GetName(endpoint, method string) string

GetName create URL-friendly name for service All parameters will be replaced with "x" in order to avoid adding the same paths differing only in the name of the parameters

func GetRouteForGoji

func GetRouteForGoji(endpoint string) string

Types

type Chi

type Chi struct {
	// contains filtered or unexported fields
}

func NewChi

func NewChi(r chi.Router) *Chi

func (*Chi) Services

func (c *Chi) Services() ([]Service, error)

type Client

type Client struct {
	Endpoint string
}

func (*Client) AddAPI

func (j *Client) AddAPI(api *Service) error

func (*Client) GetAPI

func (j *Client) GetAPI(name string) (*Service, error)

func (*Client) UpdateAPI

func (j *Client) UpdateAPI(name string, api *Service) error

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Body

func (e Error) Body() []byte

func (Error) Error

func (e Error) Error() string

func (Error) Status

func (e Error) Status() int

type Proxy

type Proxy struct {
	// Enabling this flag instructs Janus that when proxying this API,
	// it should always include the matching URI prefix in the upstream request's URI
	AppendPath bool      `json:"append_path"`
	ListenPath string    `json:"listen_path"`
	Upstreams  Upstreams `json:"upstreams"`
	Methods    []string  `json:"methods"`
}

type Response

type Response []byte

type Service

type Service struct {
	Name    string `json:"name"`
	Surname string `json:"surname"`
	Active  bool   `json:"active"`
	Proxy   Proxy  `json:"proxy"`
}

type Status

type Status int

type Target

type Target struct {
	Target string `json:"target"`
	Weight int    `json:"weight"`
}

type Upstreams

type Upstreams struct {
	Balancing string   `json:"balancing"`
	Targets   []Target `json:"targets"`
}

Jump to

Keyboard shortcuts

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