webgrapple

module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT

README

WebGrapple

A proxy and a client to take over routes of a remote server with local web servers

Example

package main

import (
	"net/http"
	"net/url"

	"github.com/foomo/webgrapple/cmd/webgrapple"
	"github.com/foomo/webgrapple/pkg/server"
	"github.com/foomo/webgrapple/pkg/utils"
	"go.uber.org/zap"
)

func main() {
	logger := utils.GetLogger()
	webgrapple.MiddlewareFactory = func(services server.ServiceMap, backendURL *url.URL) (server.Middleware, error) {
		logger.Info("new configuration")
		return func(next http.HandlerFunc) http.HandlerFunc {
			return func(w http.ResponseWriter, r *http.Request) {

			}
		}, nil
	}
	errExecute := webgrapple.Command.Execute()
	if errExecute != nil {
		utils.GetLogger().Error("execution error", zap.Error(errExecute))
	}
}

How to Contribute

Please refer to the CONTRIBUTING details and follow the CODE_OF_CONDUCT and SECURITY guidelines.

License

Distributed under MIT License, please see license file within the code for more details.

Made with ♥ foomo by bestbytes

Directories

Path Synopsis
cmd
pkg
log
vo

Jump to

Keyboard shortcuts

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