hoproxy

package module
v0.0.0-...-c20879c Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 11 Imported by: 0

README

hoproxy

Usage

Example

  • config.yml
server:
    port: 8088
exchange:
  - method: POST
    path: /api/post
    call_cli: /usr/local/bin/post.sh
  - method: GET
    path: /search
    call_uri: https://www.google.com/search
  - method: DELETE
    path: /api/delete
    call_cli: /usr/local/bin/delete.sh
  - method: PUT
    path: /api/put
    call_uri: https://example.com/api/put

start server

$ hoproxy -conf config.yml

Documentation

Index

Constants

View Source
const Version = "0.0.1"

Version TODO あとで

Variables

View Source
var CommandTimeout = 60 * time.Second

CommandTimeout TODO あとで書く

View Source
var MaxOutputLength = 1000

MaxOutputLength TODO あとで書く

Functions

func Run

func Run(cfg *Config)

Run TODO あとで書く

Types

type Call

type Call struct {
	URI string
	Cli string
}

Call TODO あとで書く

type Config

type Config struct {
	Server    *Server     `yaml:"server"`
	Exchanges []*Exchange `yaml:"exchange"`
}

Config TODO あとで書く

func NewConfig

func NewConfig(path string) *Config

NewConfig TODO あとで書く

type Exchange

type Exchange struct {
	Method  string `yaml:"method"`
	Path    string `yaml:"path"`
	CallURI string `yaml:"call_uri"`
	CallCli string `yaml:"call_cli"`
}

Exchange TODO あとで書く

type ExchangeCli

type ExchangeCli struct {
	Body  string
	Error error
	// contains filtered or unexported fields
}

ExchangeCli TODO あとで書く

type ExchangeResponse

type ExchangeResponse struct {
	StatusCode int
	Body       string
}

ExchangeResponse TODO あとで書く

type ExchangeTree

type ExchangeTree struct {
	GET    map[string]*Call
	POST   map[string]*Call
	PUT    map[string]*Call
	DELETE map[string]*Call
	OTHER  map[string]*Call
}

ExchangeTree TODO あとで書く

func CreateExchangeTree

func CreateExchangeTree(cfg *Config) *ExchangeTree

CreateExchangeTree TODO あとで書く

type Server

type Server struct {
	Port int `yaml:"port"`
}

Server TODO あとで書く

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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