gateway

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package gateway defines gateway service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetSingleton added in v0.2.2

func ResetSingleton()

Types

type Config

type Config struct {
	APIPrefix       string //like /v1/api/
	RouteURL        string
	DependencyURL   string
	UseCacheFS      bool
	SyncFrequencyMs int
	Secrets         []*secret.Resource
	JWTValidator    *verifier.Config
	Cognito         *cognito.Config
	Meta            meta.Config
	AutoDiscovery   *bool
}

func NewConfigFromURL

func NewConfigFromURL(ctx context.Context, URL string) (*Config, error)

func (*Config) Discovery added in v0.2.1

func (c *Config) Discovery() bool

func (*Config) Init

func (c *Config) Init()

func (*Config) Validate

func (c *Config) Validate() error

type Service

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

Service represents gateway service

func New

func New(ctx context.Context, config *Config, visitors codec.Visitors, types view.Types, metrics *gmetric.Service) (*Service, error)

New creates a gateway service

func Singleton

func Singleton(configURL string, visitors codec.Visitors, types view.Types, metric *gmetric.Service) (*Service, error)

func SingletonWithConfig

func SingletonWithConfig(config *Config, visitors codec.Visitors, types view.Types, metric *gmetric.Service) (*Service, error)

func (*Service) Handle

func (r *Service) Handle(writer http.ResponseWriter, request *http.Request)

func (*Service) Routes added in v0.2.1

func (r *Service) Routes(route string) []*router.Route

func (*Service) View

func (r *Service) View(method, location string) (*view.View, error)

Directories

Path Synopsis
runtime
apigw
Package apigw defines apigw lambda datly runtime
Package apigw defines apigw lambda datly runtime
gcf
Package gcf defines Google Cloud Functions entry point
Package gcf defines Google Cloud Functions entry point
gcr
Package gcr defines Google Cloud Run entry point
Package gcr defines Google Cloud Run entry point
lambda
Package lambda defines lambda datly runtime
Package lambda defines lambda datly runtime

Jump to

Keyboard shortcuts

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