server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEndPoint = "/___webgrapple-service"
View Source
const DefaultServiceURL = "http://127.0.0.1:8888"

Variables

This section is empty.

Functions

func Run

func Run(
	ctx context.Context,
	l log.Logger,
	serviceAddress, backendURLString string,
	urlStrings []string,
	certFile, keyFile string,
	middlewareFactory WebGrappleMiddleWareCreator,
) error

Types

type HTTPServiceGoTSRPCClient

type HTTPServiceGoTSRPCClient struct {
	URL      string
	EndPoint string
	Client   gotsrpc.Client
}

func NewDefaultServiceGoTSRPCClient

func NewDefaultServiceGoTSRPCClient(url string) *HTTPServiceGoTSRPCClient

func NewServiceGoTSRPCClient

func NewServiceGoTSRPCClient(url string, endpoint string) *HTTPServiceGoTSRPCClient

func NewServiceGoTSRPCClientWithClient

func NewServiceGoTSRPCClientWithClient(url string, endpoint string, client *net_http.Client) *HTTPServiceGoTSRPCClient

func (*HTTPServiceGoTSRPCClient) Remove

func (*HTTPServiceGoTSRPCClient) Upsert

type Middleware

type Middleware func(next http.HandlerFunc) http.HandlerFunc

Middleware your way to handle requests

type Service

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

func (*Service) Remove

func (s *Service) Remove(serviceIDs []vo.ServiceID) (err *vo.ServiceError)

func (*Service) Upsert

func (s *Service) Upsert(services []*vo.Service) (err *vo.ServiceError)

type ServiceGoTSRPCClient

type ServiceGoTSRPCClient interface {
	Remove(serviceIDs []github_com_foomo_webgrapple_vo.ServiceID) (err *github_com_foomo_webgrapple_vo.ServiceError, clientErr error)
	Upsert(services []*github_com_foomo_webgrapple_vo.Service) (err *github_com_foomo_webgrapple_vo.ServiceError, clientErr error)
}

type ServiceGoTSRPCProxy

type ServiceGoTSRPCProxy struct {
	EndPoint string
	// contains filtered or unexported fields
}

func NewDefaultServiceGoTSRPCProxy

func NewDefaultServiceGoTSRPCProxy(service Service, allowOrigin []string) *ServiceGoTSRPCProxy

func NewServiceGoTSRPCProxy

func NewServiceGoTSRPCProxy(service Service, endpoint string, allowOrigin []string) *ServiceGoTSRPCProxy

func (*ServiceGoTSRPCProxy) ServeHTTP

func (p *ServiceGoTSRPCProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP exposes your service

type ServiceMap

type ServiceMap map[vo.ServiceID]*vo.Service

ServiceMap a map of registered services

type WebGrappleMiddleWareCreator

type WebGrappleMiddleWareCreator func(services ServiceMap, fallbackServerURL *url.URL) (middleware Middleware, errCreation error)

WebGrappleMiddleWareCreator create a project specific middleware, when configs change

Jump to

Keyboard shortcuts

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