Documentation
¶
Overview ¶
Package runtime implements the functions, types, and interfaces for the module.
Package runtime implements the functions, types, and interfaces for the module.
Package runtime implements the functions, types, and interfaces for the module.
Package runtime implements the functions, types, and interfaces for the module.
Package runtime implements the functions, types, and interfaces for the module.
Package runtime implements the functions, types, and interfaces for the module.
Package runtime implements the functions, types, and interfaces for the module.
Package runtime provides functions for loading configurations and registering services.
Index ¶
- Constants
- Variables
- func LoadConfig(path string, v any, ss ...config.Option) error
- func LoadConfigFromBootstrap(bs *bootstrap.Bootstrap, v any, ss ...config.Option) error
- func NewConfig(cfg *configv1.SourceConfig, ss ...config.Option) (config.KConfig, error)
- func NewDiscovery(cfg *configv1.Discovery, ss ...registry.Option) (registry.KDiscovery, error)
- func NewGRPCServiceClient(ctx context.Context, cfg *configv1.Service, ss ...service.GRPCOption) (*service.GRPCClient, error)
- func NewGRPCServiceServer(cfg *configv1.Service, ss ...service.GRPCOption) (*service.GRPCServer, error)
- func NewHTTPServiceClient(ctx context.Context, cfg *configv1.Service, ss ...service.HTTPOption) (*service.HTTPClient, error)
- func NewHTTPServiceServer(cfg *configv1.Service, ss ...service.HTTPOption) (*service.HTTPServer, error)
- func NewMiddlewareClient(name string, cm *middlewarev1.Middleware, ss ...middleware.Option) (middleware.KMiddleware, error)
- func NewMiddlewareServer(name string, cm *middlewarev1.Middleware, ss ...middleware.Option) (middleware.KMiddleware, error)
- func NewMiddlewaresClient(cc *middlewarev1.Middleware, ss ...middleware.Option) []middleware.KMiddleware
- func NewMiddlewaresServer(cc *middlewarev1.Middleware, ss ...middleware.Option) []middleware.KMiddleware
- func NewRegistrar(cfg *configv1.Discovery, ss ...registry.Option) (registry.KRegistrar, error)
- func RegisterConfig(name string, factory config.Factory)
- func RegisterConfigFunc(name string, buildFunc config.BuildFunc)
- func RegisterConfigSync(name string, syncFunc config.Syncer)
- func RegisterMiddleware(name string, builder middleware.Factory)
- func RegisterRegistry(name string, factory registry.Factory)
- func RegisterService(name string, factory service.ServerFactory)
- func SyncConfig(cfg *configv1.SourceConfig, v any, ss ...config.Option) error
- type Builder
- type Logger
- type Manager
- type MiddlewareBuildFunc
- type MiddlewareBuilder
- type MiddlewareBuilders
- type MiddlewareProvider
- type Option
- func WithConfigOptions(options ...config.Option) Option
- func WithContext(ctx context.Context) Option
- func WithDefaultOptions() Option
- func WithLogger(logger log.Logger) Option
- func WithPrefix(prefix string) Option
- func WithResolver(resolver config.Resolver) Option
- func WithSignals(signals ...os.Signal) Option
- type Options
- type Runtime
- type ServiceProvider
- type SignalHandler
Constants ¶
const (
DefaultEnvPrefix = "ORIGADMIN_RUNTIME_SERVICE"
)
Variables ¶
var ErrNotFound = errors.String("not found")
ErrNotFound is an error that is returned when a ConfigBuilder or RegistryBuilder is not found.
Functions ¶
func LoadConfig ¶ added in v0.2.0
LoadConfig loads the config file from the given path
func LoadConfigFromBootstrap ¶ added in v0.2.0
func NewDiscovery ¶
NewDiscovery creates a new discovery using the registered RegistryBuilder.
func NewGRPCServiceClient ¶
func NewGRPCServiceClient(ctx context.Context, cfg *configv1.Service, ss ...service.GRPCOption) (*service.GRPCClient, error)
NewGRPCServiceClient creates a new GRPC client using the provided context and configuration
func NewGRPCServiceServer ¶
func NewGRPCServiceServer(cfg *configv1.Service, ss ...service.GRPCOption) (*service.GRPCServer, error)
NewGRPCServiceServer creates a new GRPC server using the provided configuration
func NewHTTPServiceClient ¶
func NewHTTPServiceClient(ctx context.Context, cfg *configv1.Service, ss ...service.HTTPOption) (*service.HTTPClient, error)
NewHTTPServiceClient creates a new HTTP client using the provided context and configuration
func NewHTTPServiceServer ¶
func NewHTTPServiceServer(cfg *configv1.Service, ss ...service.HTTPOption) (*service.HTTPServer, error)
NewHTTPServiceServer creates a new HTTP server using the provided configuration
func NewMiddlewareClient ¶
func NewMiddlewareClient(name string, cm *middlewarev1.Middleware, ss ...middleware.Option) (middleware.KMiddleware, error)
NewMiddlewareClient creates a new KMiddleware with the builder.
func NewMiddlewareServer ¶
func NewMiddlewareServer(name string, cm *middlewarev1.Middleware, ss ...middleware.Option) (middleware.KMiddleware, error)
NewMiddlewareServer creates a new KMiddleware with the builder.
func NewMiddlewaresClient ¶
func NewMiddlewaresClient(cc *middlewarev1.Middleware, ss ...middleware.Option) []middleware.KMiddleware
NewMiddlewaresClient creates a new KMiddleware with the builder.
func NewMiddlewaresServer ¶
func NewMiddlewaresServer(cc *middlewarev1.Middleware, ss ...middleware.Option) []middleware.KMiddleware
NewMiddlewaresServer creates a new KMiddleware with the builder.
func NewRegistrar ¶
NewRegistrar creates a new KRegistrar using the registered RegistryBuilder.
func RegisterConfig ¶
RegisterConfig registers a ConfigBuilder with the builder.
func RegisterConfigFunc ¶
RegisterConfigFunc registers a ConfigBuilder with the builder.
func RegisterConfigSync ¶
func RegisterMiddleware ¶
func RegisterMiddleware(name string, builder middleware.Factory)
RegisterMiddleware registers a MiddlewareBuilder with the builder.
func RegisterRegistry ¶
RegisterRegistry registers a RegistryBuilder with the builder.
func RegisterService ¶
func RegisterService(name string, factory service.ServerFactory)
RegisterService registers a service builder with the provided name
func SyncConfig ¶
SyncConfig synchronizes the given configuration with the given value.
Types ¶
type Builder ¶
type Builder interface { Config() config.Builder Registry() registry.Builder Service() service.ServerBuilder Middleware() middleware.Builder NewMiddlewareClient(name string, config *middlewarev1.Middleware, ss ...middleware.Option) (middleware.KMiddleware, error) NewMiddlewareServer(name string, config *middlewarev1.Middleware, ss ...middleware.Option) (middleware.KMiddleware, error) NewMiddlewaresClient(config *middlewarev1.Middleware, ss ...middleware.Option) []middleware.KMiddleware NewMiddlewaresServer(config *middlewarev1.Middleware, ss ...middleware.Option) []middleware.KMiddleware RegisterMiddlewareBuilder(name string, builder middleware.Factory) NewRegistrar(cfg *configv1.Discovery, ss ...registry.Option) (registry.KRegistrar, error) NewDiscovery(cfg *configv1.Discovery, ss ...registry.Option) (registry.KDiscovery, error) RegisterRegistryBuilder(name string, factory registry.Factory) RegisterRegistryFunc(name string, registryBuilder registry.RegistrarBuildFunc, discoveryBuilder registry.DiscoveryBuildFunc) NewConfig(sourceConfig *configv1.SourceConfig, options ...config.Option) (config.KConfig, error) RegisterConfigBuilder(s string, factory config.Factory) NewServer(name string, c *configv1.Service, options ...service.ServerOption) (transport.Server, error) NewGRPCServer(c *configv1.Service, options ...service.GRPCOption) (*service.GRPCServer, error) NewHTTPServer(c *configv1.Service, options ...service.HTTPOption) (*service.HTTPServer, error) NewGRPCClient(c context.Context, c2 *configv1.Service, options ...service.GRPCOption) (*service.GRPCClient, error) NewHTTPClient(c context.Context, c2 *configv1.Service, options ...service.HTTPOption) (*service.HTTPClient, error) RegisterServiceBuilder(name string, factory service.ServerFactory) SyncConfig(cfg *configv1.SourceConfig, v any, ss ...config.Option) error RegisterConfigSyncer(name string, configSyncer config.Syncer) RegisterConfigSync(name string, configSyncer config.Syncer) }
func GlobalBuilder ¶ added in v0.1.38
func GlobalBuilder() Builder
GlobalBuilder returns the global Builder instance.
type Manager ¶ added in v0.2.0
type Manager struct { Middleware MiddlewareProvider Service ServiceProvider }
type MiddlewareBuildFunc ¶
type MiddlewareBuildFunc = func(*configv1.Customize_Config, ...middleware.Option) (middleware.KMiddleware, error)
MiddlewareBuildFunc is an interface that defines methods for creating middleware.
type MiddlewareBuilder ¶
type MiddlewareBuilder interface { // NewMiddlewareClient build middleware NewMiddlewareClient(*configv1.Customize_Config, ...middleware.Option) (middleware.KMiddleware, error) // NewMiddlewareServer build middleware NewMiddlewareServer(*configv1.Customize_Config, ...middleware.Option) (middleware.KMiddleware, error) }
MiddlewareBuilder middleware builder interface
type MiddlewareBuilders ¶
type MiddlewareBuilders interface { // NewMiddlewaresClient build middleware NewMiddlewaresClient(*middlewarev1.Middleware, ...middleware.Option) []middleware.KMiddleware // NewMiddlewaresServer build middleware NewMiddlewaresServer(*middlewarev1.Middleware, ...middleware.Option) []middleware.KMiddleware // NewMiddlewareClient build middleware NewMiddlewareClient(string, *middlewarev1.Middleware, ...middleware.Option) (middleware.KMiddleware, error) // NewMiddlewareServer build middleware NewMiddlewareServer(string, *middlewarev1.Middleware, ...middleware.Option) (middleware.KMiddleware, error) }
MiddlewareBuilders middleware builders for runtime
type MiddlewareProvider ¶ added in v0.2.0
type MiddlewareProvider interface { BuildClient(cfg *middlewarev1.Middleware, opts ...middleware.Option) []middleware.KMiddleware BuildServer(cfg *middlewarev1.Middleware, opts ...middleware.Option) []middleware.KMiddleware }
type Option ¶ added in v0.2.0
type Option func(*Options)
func WithConfigOptions ¶ added in v0.2.0
func WithContext ¶ added in v0.2.1
func WithDefaultOptions ¶ added in v0.2.1
func WithDefaultOptions() Option
func WithLogger ¶ added in v0.2.1
func WithPrefix ¶ added in v0.2.0
func WithResolver ¶ added in v0.2.1
func WithSignals ¶ added in v0.2.1
type Runtime ¶ added in v0.1.15
type ServiceProvider ¶ added in v0.2.0
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
api
|
|
Package bootstrap is a package that provides the bootstrap information for the service.
|
Package bootstrap is a package that provides the bootstrap information for the service. |
Package config implements the functions, types, and interfaces for the module.
|
Package config implements the functions, types, and interfaces for the module. |
customize
Package customize implements the functions, types, and interfaces for the module.
|
Package customize implements the functions, types, and interfaces for the module. |
envsetup
Package envsetup implements the functions, types, and interfaces for the module.
|
Package envsetup implements the functions, types, and interfaces for the module. |
file
Package file implements the functions, types, and interfaces for the module.
|
Package file implements the functions, types, and interfaces for the module. |
internal/reflection
Package reflection implements the functions, types, and interfaces for the module.
|
Package reflection implements the functions, types, and interfaces for the module. |
Package context provides the context functions
|
Package context provides the context functions |
interfaces
|
|
database
Package database implements the functions, types, and interfaces for the module.
|
Package database implements the functions, types, and interfaces for the module. |
factory
Package factory implements the functions, types, and interfaces for the module.
|
Package factory implements the functions, types, and interfaces for the module. |
pagination
Package pagination implements the functions, types, and interfaces for the module.
|
Package pagination implements the functions, types, and interfaces for the module. |
security
Package security implements the functions, types, and interfaces for the module.
|
Package security implements the functions, types, and interfaces for the module. |
security/token
Package token provides token caching functionality for security module
|
Package token provides token caching functionality for security module |
storage/cache
Package cache implements the functions, types, and interfaces for the module.
|
Package cache implements the functions, types, and interfaces for the module. |
storage/meta
Package meta implements the functions, types, and interfaces for the module.
|
Package meta implements the functions, types, and interfaces for the module. |
internal
|
|
auth
Package auth implements the functions, types, and interfaces for the module.
|
Package auth implements the functions, types, and interfaces for the module. |
Package log implements the functions, types, and interfaces for the module.
|
Package log implements the functions, types, and interfaces for the module. |
Package mail implements the functions, types, and interfaces for the module.
|
Package mail implements the functions, types, and interfaces for the module. |
Package middleware implements the functions, types, and interfaces for the module.
|
Package middleware implements the functions, types, and interfaces for the module. |
empty
Package empty implements the functions, types, and interfaces for the module.
|
Package empty implements the functions, types, and interfaces for the module. |
optimize
Package optimize implements the functions, types, and interfaces for the module.
|
Package optimize implements the functions, types, and interfaces for the module. |
selector
Package selector implements the functions, types, and interfaces for the module.
|
Package selector implements the functions, types, and interfaces for the module. |
validate
Package validate implements the functions, types, and interfaces for the module.
|
Package validate implements the functions, types, and interfaces for the module. |
Package registry implements the functions, types, and interfaces for the module.
|
Package registry implements the functions, types, and interfaces for the module. |
Package service implements the functions, types, and interfaces for the module.
|
Package service implements the functions, types, and interfaces for the module. |
endpoint
Package endpoint implements the functions, types, and interfaces for the module.
|
Package endpoint implements the functions, types, and interfaces for the module. |
grpc
Package grpc implements the functions, types, and interfaces for the module.
|
Package grpc implements the functions, types, and interfaces for the module. |
http
Package http implements the functions, types, and interfaces for the module.
|
Package http implements the functions, types, and interfaces for the module. |
selector
Package selector implements the functions, types, and interfaces for the module.
|
Package selector implements the functions, types, and interfaces for the module. |
tls
Package service implements the functions, types, and interfaces for the module.
|
Package service implements the functions, types, and interfaces for the module. |
Package storage implements the functions, types, and interfaces for the module.
|
Package storage implements the functions, types, and interfaces for the module. |
meta
Package meta implements the functions, types, and interfaces for the module.
|
Package meta implements the functions, types, and interfaces for the module. |
meta/v1
Package metav1 implements the functions, types, and interfaces for the module.
|
Package metav1 implements the functions, types, and interfaces for the module. |
meta/v2
Package metav2 implements the functions, types, and interfaces for the module.
|
Package metav2 implements the functions, types, and interfaces for the module. |