Documentation
¶
Index ¶
- Variables
- func AdjustAppInfo(ai *appv1.App)
- func CloneAppInfo(src *appv1.App) *appv1.App
- func NewAppInfo(name, version string) *appv1.App
- func NewAppInfoBuilder() *appv1.App
- func NewContext(ctx context.Context) context.Context
- func NewInstanceID(project, appID, version, host string) string
- func NewTrace(ctx context.Context, traceID string) context.Context
- func ProvideDefaultRegistrar(rt *App) (kregistry.Registrar, error)
- func ProvideLogger(rt *App) log.Logger
- func Register(cat Category, p Provider, opts ...RegisterOption)
- func ResolveHost() string
- func UpdateAppInfo(dst, src *appv1.App)
- type App
- func (r *App) AppInfo() *appv1.App
- func (r *App) Config() any
- func (r *App) Container() component.Container
- func (r *App) Context() context.Context
- func (r *App) Decoder() runtimeconfig.KConfig
- func (r *App) DefaultRegistrar() (kregistry.Registrar, error)
- func (r *App) Discoveries() (map[string]registry.KDiscovery, error)
- func (r *App) In(cat Category, opts ...InOption) component.Registry
- func (r *App) Load(path string, bootOpts ...bootstrap.Option) error
- func (r *App) Logger() log.Logger
- func (r *App) NewApp(servers []transport.Server, options ...kratos.Option) *kratos.App
- func (r *App) Result() bootstrap.Result
- func (r *App) ShowAppInfo()
- func (r *App) Stop()
- func (r *App) WarmUp() error
- type AppOption
- type Category
- type ConfigEntry
- type ConfigResolver
- type Container
- type Handle
- type InOption
- type LoadOption
- type Locator
- type ModuleConfig
- type Option
- type Priority
- type Provider
- type RegisterOption
- func WithEntries(names ...string) RegisterOption
- func WithRequirement(f func(ctx context.Context, h component.Handle, purpose string) (any, error)) RegisterOption
- func WithResolver(res component.ConfigResolver) RegisterOption
- func WithScopes(ss ...Scope) RegisterOption
- func WithTag(tag string) RegisterOption
- type Registration
- type RegistrationOptions
- type Registry
- type RequirementResolver
- type Scope
Constants ¶
This section is empty.
Variables ¶
var DefaultResolvers = map[component.Category]component.ConfigResolver{ CategoryLogger: log.Resolve, CategoryRegistrar: registry.Resolve, CategoryDiscovery: registry.Resolve, CategoryMiddleware: middleware.Resolve, CategoryDatabase: database.Resolve, CategoryCache: cache.Resolve, CategoryObjectStore: objectstore.Resolve, }
Functions ¶
func AdjustAppInfo ¶ added in v0.2.19
AdjustAppInfo adjusts the application info, setting default values.
func CloneAppInfo ¶ added in v0.2.19
CloneAppInfo clones the application info.
func NewAppInfo ¶ added in v0.2.6
NewAppInfo creates a new application information instance.
func NewAppInfoBuilder ¶ added in v0.2.14
NewAppInfoBuilder returns a new, blank App instance for building.
func NewContext ¶ added in v0.2.19
NewContext creates a new context from the app context.
func NewInstanceID ¶ added in v0.2.19
NewInstanceID generates an instance ID.
func ProvideDefaultRegistrar ¶ added in v0.2.6
ProvideDefaultRegistrar is a Wire provider function that extracts the registrar from the App.
func ProvideLogger ¶ added in v0.2.6
ProvideLogger is a Wire provider function that extracts the logger from the App.
func Register ¶ added in v0.2.19
func Register(cat Category, p Provider, opts ...RegisterOption)
Register adds a component registration to the engine.
func ResolveHost ¶ added in v0.2.19
func ResolveHost() string
ResolveHost returns the host identifier.
func UpdateAppInfo ¶ added in v0.2.19
UpdateAppInfo merges application information from a source App into a destination App. Only non-empty fields from the source will overwrite the destination fields.
Types ¶
type App ¶ added in v0.2.13
type App struct {
// contains filtered or unexported fields
}
App defines the application's runtime environment powered by engine.
func NewWithAppInfo ¶ added in v0.2.19
NewWithAppInfo creates a new App instance using a pre-configured App info.
func (*App) DefaultRegistrar ¶ added in v0.2.13
func (*App) Discoveries ¶ added in v0.2.19
func (r *App) Discoveries() (map[string]registry.KDiscovery, error)
func (*App) ShowAppInfo ¶ added in v0.2.19
func (r *App) ShowAppInfo()
type Category ¶ added in v0.2.19
const ( CategoryInfrastructure Category = "infrastructure" CategoryLogger Category = "logger" CategoryRegistrar Category = "registrar" CategoryDiscovery Category = "discovery" CategoryClient Category = "client" CategoryServer Category = "server" CategoryMiddleware Category = "middleware" CategoryDatabase Category = "database" CategoryCache Category = "cache" CategoryObjectStore Category = "objectstore" CategoryQueue Category = "queue" CategoryTask Category = "task" CategoryMail Category = "mail" CategoryStorage Category = "storage" CategorySecurity Category = "security" CategorySkipper Category = "skipper" )
type ConfigEntry ¶ added in v0.2.19
type ConfigEntry = component.ConfigEntry
type ConfigResolver ¶ added in v0.2.19
type ConfigResolver = component.ConfigResolver
type InOption ¶ added in v0.2.19
func WithInScope ¶ added in v0.2.19
WithInScope specifies the perspective scope.
func WithInTags ¶ added in v0.2.19
WithInTags specifies the perspective tags.
type LoadOption ¶ added in v0.2.19
type LoadOption = component.LoadOption
type ModuleConfig ¶ added in v0.2.19
type ModuleConfig = component.ModuleConfig
type Option ¶ added in v0.2.0
type Option func(*App)
Option is a functional option for configuring the App. It allows for applying configurations to the App instance at creation time.
func WithContainer ¶ added in v0.2.19
WithContainer sets a callback to configure the internal engine container.
func WithMetadata ¶ added in v0.2.13
WithMetadata adds a key-value pair to the application's metadata.
func WithMetadataMap ¶ added in v0.2.13
WithMetadataMap adds a map of key-value pairs to the application's metadata.
func WithStartTime ¶ added in v0.2.13
WithStartTime sets a custom start time.
type RegisterOption ¶ added in v0.2.19
type RegisterOption = component.RegisterOption
func WithEntries ¶ added in v0.2.19
func WithEntries(names ...string) RegisterOption
WithEntries specifies the default entries for a component.
func WithRequirement ¶ added in v0.2.19
func WithRequirement(f func(ctx context.Context, h component.Handle, purpose string) (any, error)) RegisterOption
WithRequirement specifies a local requirement resolver for a component.
func WithResolver ¶ added in v0.2.1
func WithResolver(res component.ConfigResolver) RegisterOption
WithResolver specifies a local config resolver for a component.
func WithScopes ¶ added in v0.2.19
func WithScopes(ss ...Scope) RegisterOption
WithScopes specifies the scopes for a component.
func WithTag ¶ added in v0.2.19
func WithTag(tag string) RegisterOption
WithTag specifies the tag for a component.
type Registration ¶ added in v0.2.19
type Registration = component.Registration
type RegistrationOptions ¶ added in v0.2.19
type RegistrationOptions = component.RegistrationOptions
type RequirementResolver ¶ added in v0.2.19
type RequirementResolver = component.RequirementResolver
Directories
¶
| Path | Synopsis |
|---|---|
|
api
|
|
|
Package config contains generated code by adptool.
|
Package config contains generated code by adptool. |
|
envsource
Package envsource is a configuration source that loads environment variables.
|
Package envsource is a configuration source that loads environment variables. |
|
file
Package file implements the functions, types, and contracts for the module.
|
Package file implements the functions, types, and contracts for the module. |
|
internal/reflection
Package reflection implements the functions, types, and contracts for the module.
|
Package reflection implements the functions, types, and contracts for the module. |
|
protoutil
Package protoutil provides utility functions for working with protobuf Any messages.
|
Package protoutil provides utility functions for working with protobuf Any messages. |
|
broker
Package broker defines a generic interface for a message broker.
|
Package broker defines a generic interface for a message broker. |
|
storage
Package storage defines the contracts for storage services.
|
Package storage defines the contracts for storage services. |
|
storage/database
Package database implements the functions, types, and contracts for the module.
|
Package database implements the functions, types, and contracts for the module. |
|
data
|
|
|
storage
Package storage provides a unified interface for various storage solutions including cache, database, and file storage.
|
Package storage provides a unified interface for various storage solutions including cache, database, and file storage. |
|
storage/cache
Package cache provides a factory function to create Cache instances.
|
Package cache provides a factory function to create Cache instances. |
|
storage/database
Package database implements the functions, types, and contracts for the module.
|
Package database implements the functions, types, and contracts for the module. |
|
storage/objectstore
Package objectstore provides a factory function to create ObjectStore instances.
|
Package objectstore provides a factory function to create ObjectStore instances. |
|
context
Package context contains generated code by adptool.
|
Package context contains generated code by adptool. |
|
Package errors provides enhanced error handling with module support, error codes, and metadata.
|
Package errors provides enhanced error handling with module support, error codes, and metadata. |
|
examples
|
|
|
configs/bootstrap_sample
command
|
|
|
configs/load_with_custom_parser
command
|
|
|
configs/load_with_interface
command
|
|
|
configs/load_with_runtime
command
|
|
|
storage
command
|
|
|
helpers
|
|
|
comp
Package comp provides concise generic utility functions for component handling.
|
Package comp provides concise generic utility functions for component handling. |
|
optionutil
Package optionutil provides utility functions for working with options.Context.
|
Package optionutil provides utility functions for working with options.Context. |
|
Package log implements the functions, types, and contracts for the module.
|
Package log implements the functions, types, and contracts for the module. |
|
Package middleware implements the functions, types, and contracts for the module.
|
Package middleware implements the functions, types, and contracts for the module. |
|
cors
Package cors implements CORS middleware for the framework.
|
Package cors implements CORS middleware for the framework. |
|
validate
Package validate implements the functions, types, and contracts for the module.
|
Package validate implements the functions, types, and contracts for the module. |
|
Package registry implements the functions, types, and contracts for the module.
|
Package registry implements the functions, types, and contracts for the module. |
|
Package service implements the functions, types, and contracts for the module.
|
Package service implements the functions, types, and contracts for the module. |
|
selector
Package selector contains generated code by adptool.
|
Package selector contains generated code by adptool. |
|
tls
Package tls implements the functions, types, and contracts for the module.
|
Package tls implements the functions, types, and contracts for the module. |
|
transport
Package transport contains generated code by adptool.
|
Package transport contains generated code by adptool. |
|
tests
|
|