module

package
v0.0.0-...-8450a52 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError interface {
	InternalServerError(ktx kontext.Context) jsonapi.Option
	BadRequestError(in string) jsonapi.Option
	NotFoundError(ktx kontext.Context, entityType string) jsonapi.Option
	UnauthorizedError() jsonapi.Option
	ForbiddenError(ktx kontext.Context, entityType, reason string) jsonapi.Option
	ValidationError(msg string) jsonapi.Option
}

type App

type App interface {
	// TODO: Enable config via module package instead of cfg
	// Config() Config
	Controller() Controller
}

type CommandController

type CommandController interface {
	Use() string
	Short() string
	Example() string
	Run(cmd *cobra.Command, args []string)
	ModifyFlags(flags *pflag.FlagSet)
}

type Config

type Config interface {
	Port() int
	BasicAuthUsername() string
	BasicAuthPassword() string
	ProxyHost() string
	Dump() string
}

type Controller

type Controller interface {
	InjectMetric(http ...MetricController)
	InjectHTTP(http ...HttpController)
	InjectCommand(command ...CommandController)
	InjectDownstream(downstream ...DownstreamController)

	ListDownstream() []DownstreamController
	ListMetric() []MetricController
}

type DownstreamController

type DownstreamController interface {
	Name() string
	Intervene(c *gin.Context, proxyReq *http.Request, r RouterPath) error
}

type HttpController

type HttpController interface {
	Control(ktx kontext.Context, c *gin.Context)

	// Relative path
	// /oauth/applications
	Path() string

	// GET PUT POST
	Method() string
}

type MetricController

type MetricController interface {
	InjectCounter(metricName string, labels ...string)
	InjectHistogram(metricName string, labels ...string)
	Inc(metricName string, labels map[string]string) error
	Observe(metricName string, value float64, labels map[string]string) error
}

type Plugin

type Plugin interface {
	List() []string
	Exist(plugin string) bool
	Plugin(plugin string)
	Dump() string
}

type RouterPath

type RouterPath interface {
	GetAuth() string
	GetScope() string
}

Directories

Path Synopsis
app
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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