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 provides functions for loading configurations and registering services.
Index ¶
- Constants
- Variables
- func NewConfig(cfg *configv1.SourceConfig, ss ...config.OptionSetting) (config.KConfig, error)
- func NewDiscovery(cfg *configv1.Registry, ss ...registry.OptionSetting) (registry.KDiscovery, error)
- func NewGRPCServiceClient(ctx context.Context, cfg *configv1.Service, ss ...service.OptionSetting) (*service.GRPCClient, error)
- func NewGRPCServiceServer(cfg *configv1.Service, ss ...service.OptionSetting) (*service.GRPCServer, error)
- func NewHTTPServiceClient(ctx context.Context, cfg *configv1.Service, ss ...service.OptionSetting) (*service.HTTPClient, error)
- func NewHTTPServiceServer(cfg *configv1.Service, ss ...service.OptionSetting) (*service.HTTPServer, error)
- func NewMiddlewareClient(name string, cm *configv1.Customize_Config, ss ...middleware.OptionSetting) (middleware.KMiddleware, error)
- func NewMiddlewareServer(name string, cm *configv1.Customize_Config, ss ...middleware.OptionSetting) (middleware.KMiddleware, error)
- func NewMiddlewaresClient(cc *configv1.Customize, ss ...middleware.OptionSetting) []middleware.KMiddleware
- func NewMiddlewaresServer(cc *configv1.Customize, ss ...middleware.OptionSetting) []middleware.KMiddleware
- func NewRegistrar(cfg *configv1.Registry, ss ...registry.OptionSetting) (registry.KRegistrar, error)
- func RegisterConfig(name string, factory config.Factory)
- func RegisterConfigFunc(name string, buildFunc config.BuildFunc)
- func RegisterConfigSync(name string, syncFunc ConfigSyncFunc)
- func RegisterMiddleware(name string, middlewareBuilder MiddlewareBuilder)
- func RegisterRegistry(name string, factory registry.Factory)
- func RegisterService(name string, factory service.Factory)
- func SyncConfig(cfg *configv1.SourceConfig, v any, ss ...config.OptionSetting) error
- type Builder
- type ConfigSyncFunc
- type MiddlewareBuildFunc
- type MiddlewareBuilder
- type MiddlewareBuilders
- type Runtime
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 NewConfig ¶
func NewConfig(cfg *configv1.SourceConfig, ss ...config.OptionSetting) (config.KConfig, error)
NewConfig creates a new Selector using the registered ConfigBuilder.
func NewDiscovery ¶
func NewDiscovery(cfg *configv1.Registry, ss ...registry.OptionSetting) (registry.KDiscovery, error)
NewDiscovery creates a new discovery using the registered RegistryBuilder.
func NewGRPCServiceClient ¶
func NewGRPCServiceClient(ctx context.Context, cfg *configv1.Service, ss ...service.OptionSetting) (*service.GRPCClient, error)
NewGRPCServiceClient creates a new GRPC client using the provided context and configuration
func NewGRPCServiceServer ¶
func NewGRPCServiceServer(cfg *configv1.Service, ss ...service.OptionSetting) (*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.OptionSetting) (*service.HTTPClient, error)
NewHTTPServiceClient creates a new HTTP client using the provided context and configuration
func NewHTTPServiceServer ¶
func NewHTTPServiceServer(cfg *configv1.Service, ss ...service.OptionSetting) (*service.HTTPServer, error)
NewHTTPServiceServer creates a new HTTP server using the provided configuration
func NewMiddlewareClient ¶
func NewMiddlewareClient(name string, cm *configv1.Customize_Config, ss ...middleware.OptionSetting) (middleware.KMiddleware, error)
NewMiddlewareClient creates a new KMiddleware with the builder.
func NewMiddlewareServer ¶
func NewMiddlewareServer(name string, cm *configv1.Customize_Config, ss ...middleware.OptionSetting) (middleware.KMiddleware, error)
NewMiddlewareServer creates a new KMiddleware with the builder.
func NewMiddlewaresClient ¶
func NewMiddlewaresClient(cc *configv1.Customize, ss ...middleware.OptionSetting) []middleware.KMiddleware
NewMiddlewaresClient creates a new KMiddleware with the builder.
func NewMiddlewaresServer ¶
func NewMiddlewaresServer(cc *configv1.Customize, ss ...middleware.OptionSetting) []middleware.KMiddleware
NewMiddlewaresServer creates a new KMiddleware with the builder.
func NewRegistrar ¶
func NewRegistrar(cfg *configv1.Registry, ss ...registry.OptionSetting) (registry.KRegistrar, error)
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 RegisterConfigSync(name string, syncFunc ConfigSyncFunc)
func RegisterMiddleware ¶
func RegisterMiddleware(name string, middlewareBuilder MiddlewareBuilder)
RegisterMiddleware registers a MiddlewareBuilder with the builder.
func RegisterRegistry ¶
RegisterRegistry registers a RegistryBuilder with the builder.
func RegisterService ¶
RegisterService registers a service builder with the provided name
func SyncConfig ¶
func SyncConfig(cfg *configv1.SourceConfig, v any, ss ...config.OptionSetting) error
SyncConfig synchronizes the given configuration with the given value.
Types ¶
type Builder ¶
type ConfigSyncFunc ¶
type ConfigSyncFunc func(*configv1.SourceConfig, any, ...config.OptionSetting) error
ConfigSyncFunc is a function type that takes a KConfig and a list of Options and returns an error.
func (ConfigSyncFunc) SyncConfig ¶
func (fn ConfigSyncFunc) SyncConfig(cfg *configv1.SourceConfig, v any, ss ...config.OptionSetting) error
SyncConfig is a method that implements the ConfigSyncer interface for ConfigSyncFunc.
type MiddlewareBuildFunc ¶
type MiddlewareBuildFunc = func(*configv1.Customize_Config, ...middleware.OptionSetting) (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.OptionSetting) (middleware.KMiddleware, error) // NewMiddlewareServer build middleware NewMiddlewareServer(*configv1.Customize_Config, ...middleware.OptionSetting) (middleware.KMiddleware, error) }
MiddlewareBuilder middleware builder interface
type MiddlewareBuilders ¶
type MiddlewareBuilders interface { // NewMiddlewaresClient build middleware NewMiddlewaresClient([]middleware.KMiddleware, *configv1.Customize, ...middleware.OptionSetting) []middleware.KMiddleware // NewMiddlewaresServer build middleware NewMiddlewaresServer([]middleware.KMiddleware, *configv1.Customize, ...middleware.OptionSetting) []middleware.KMiddleware // NewMiddlewareClient build middleware NewMiddlewareClient(string, *configv1.Customize_Config, ...middleware.OptionSetting) (middleware.KMiddleware, error) // NewMiddlewareServer build middleware NewMiddlewareServer(string, *configv1.Customize_Config, ...middleware.OptionSetting) (middleware.KMiddleware, error) }
MiddlewareBuilders middleware builders for runtime
type Runtime ¶ added in v0.1.15
type Runtime struct { EnvPrefix string Application application.Application Logging log.Logging Config config.Config Registry registry.Registry Middleware middleware.Middleware Service service.Service }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
agent
|
|
middleware/security
Package security implements the functions, types, and interfaces for the module.
|
Package security implements the functions, types, and interfaces for the module. |
Package application implements the functions, types, and interfaces for the module.
|
Package application implements the functions, types, and interfaces for the module. |
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. |
Package context provides the context functions
|
Package context provides the context functions |
Package customize implements the functions, types, and interfaces for the module.
|
Package customize implements the functions, types, and interfaces for the module. |
Package data implements the functions, types, and interfaces for the module.
|
Package data implements the functions, types, and interfaces for the module. |
Package fileupload implements the functions, types, and interfaces for the module.
|
Package fileupload implements the functions, types, and interfaces for the module. |
gen
|
|
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. |
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 builder implements the functions, types, and interfaces for the module.
|
Package builder 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. |