app

package
v0.0.0-...-00f25a4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextMiddleware

func ContextMiddleware(fn func(ctx context.Context) context.Context) echo.MiddlewareFunc

func DownloadPlugin

func DownloadPlugin() echo.HandlerFunc

func GraphqlAPI

func GraphqlAPI(conf GraphQLConfig) echo.HandlerFunc

func IncreasePluginDownloadCount

func IncreasePluginDownloadCount() echo.HandlerFunc

func Ping

func Ping() echo.HandlerFunc

func Start

func Start(debug bool, version string) error

func UsecaseMiddleware

func UsecaseMiddleware(r *repo.Container, g *gateway.Container) echo.MiddlewareFunc

Types

type AuthConfig

type AuthConfig struct {
	ISS *url.URL `pp:",omitempty"`
	AUD []string `pp:",omitempty"`
	ALG string   `default:"RS256"`
	TTL *int     `pp:",omitempty"`
}

type AuthM2MConfig

type AuthM2MConfig struct {
	ISS    *url.URL `pp:",omitempty"`
	AUD    []string `pp:",omitempty"`
	ALG    string   `default:"RS256" pp:",omitempty"`
	TTL    *int     `pp:",omitempty"`
	Sub    string   `pp:",omitempty"`
	Secret string   `pp:",omitempty"`
}

type Config

type Config struct {
	Port     string        `default:"8080" envconfig:"PORT"`
	DB       string        `default:"mongodb://localhost" pp:"-"`
	Auth     AuthConfig    `pp:",omitempty"`
	Auth_M2M AuthM2MConfig `pp:",omitempty"`
	GCS      GCSConfig     `pp:",omitempty"`
	GraphQL  GraphQLConfig `pp:",omitempty"`
	Origins  []string      `pp:",omitempty"`
	Debug    bool          `pp:",omitempty"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) AuthProviders

func (c *Config) AuthProviders() (p []appx.JWTProvider)

func (*Config) Print

func (c *Config) Print() string

type GCSConfig

type GCSConfig struct {
	Bucket        string `pp:",omitempty"`
	AssetsBucket  string `pp:",omitempty"`
	AssetsBaseURL string `pp:",omitempty"`
}

type GraphQLConfig

type GraphQLConfig struct {
	ComplexityLimit int `default:"6000"`
}

type ServerConfig

type ServerConfig struct {
	Config   *Config
	Debug    bool
	Repos    *repo.Container
	Gateways *gateway.Container
}

type WebServer

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

func NewServer

func NewServer(ctx context.Context, cfg *ServerConfig) *WebServer

func (*WebServer) Run

func (w *WebServer) Run()

func (*WebServer) Serve

func (w *WebServer) Serve(l net.Listener) error

func (*WebServer) ServeHTTP

func (w *WebServer) ServeHTTP(wr http.ResponseWriter, r *http.Request)

func (*WebServer) Shutdown

func (w *WebServer) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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