Documentation ¶
Index ¶
- type Component
- func (c *Component) Doc() (docs.Service, bool)
- func (c *Component) Docs() *state.Docs
- func (c *Component) Exclusion(state *view.State) []*json.FilterEntry
- func (c *Component) GenerateOutputCode(ctx context.Context, withDefineComponent, withEmbed bool, ...) string
- func (c *Component) IOConfig() *config.IOConfig
- func (c *Component) Init(ctx context.Context, resource *view.Resource) (err error)
- func (c *Component) LocatorOptions(request *http.Request, form *hstate.Form, unmarshal shared.Unmarshal) []locator.Option
- func (c *Component) LookupParameter(name string) *state.Parameter
- func (c *Component) TypeRegistry() *xreflect.Types
- func (c *Component) UnmarshalFunc(request *http.Request) shared.Unmarshal
- type ComponentOption
- func WithContract(inputType, outputType reflect.Type, embedFs *embed.FS, ...) ComponentOption
- func WithHandler(aHandler xhandler.Handler) ComponentOption
- func WithInput(inputType reflect.Type) ComponentOption
- func WithNamedResources(names ...string) ComponentOption
- func WithOutputCaseFormat(format string) ComponentOption
- func WithResource(resource *view.Resource) ComponentOption
- func WithView(aView *view.View) ComponentOption
- type Components
- type Option
- func WithApiPrefix(prefix string) Option
- func WithCacheConnectorPrefix(prefix string) Option
- func WithCodecs(codecs *codec.Registry) Option
- func WithComponentURL(componentURL string) Option
- func WithConstants(key string, value string) Option
- func WithCustomAuth(auth *custom.Service) Option
- func WithDispatcher(fn func(registry *Registry) contract.Dispatcher) Option
- func WithExtensions(registry *extension.Registry) Option
- func WithIgnorePlugin(flag bool) Option
- func WithJWTSigner(aSigner *signer.Config) Option
- func WithJWTVerifier(aVerifier *verifier.Config) Option
- func WithMetrics(metrics *gmetric.Service) Option
- func WithNoPlugin() Option
- func WithPackageTypes(types ...*view.PackagedType) Option
- func WithPath(aPath *path.Path) Option
- func WithPluginURL(URL string) Option
- func WithPredicates(predicates *extension.PredicateRegistry) Option
- func WithRefreshFrequency(refreshFrequency time.Duration) Option
- func WithResourceURL(URL string) Option
- func WithResources(resources Resources) Option
- func WithSubstitutes(name string, substitutes map[string]string) Option
- func WithTypes(types *xreflect.Types) Option
- type Options
- type Provider
- type Registry
- func (r *Registry) Dispatcher() contract.Dispatcher
- func (r *Registry) Lookup(ctx context.Context, path *contract.Path, opts ...Option) (*Component, error)
- func (r *Registry) LookupProvider(ctx context.Context, path *contract.Path) (*Provider, error)
- func (r *Registry) Register(components ...*Component)
- func (r *Registry) SetComponents(components []*Component)
- func (r *Registry) SetProviders(providers []*Provider)
- type Resources
- type Service
- func (s *Service) AuthService() *custom.Service
- func (s *Service) Constants() []*state.Parameter
- func (s *Service) Container() *path.Container
- func (s *Service) Extensions() *extension.Registry
- func (s *Service) JWTSigner() *signer.Service
- func (s *Service) JWTVerifier() *verifier.Service
- func (s *Service) Register(components ...*Component)
- func (s *Service) Registry() *Registry
- func (s *Service) Resources() Resources
- func (s *Service) SyncChanges(ctx context.Context) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { version.Version `json:"-" yaml:"-"` contract.Path contract.Contract content.Content `json:",omitempty" yaml:",inline"` Async *async.Config `json:",omitempty"` View *view.View `json:",omitempty"` NamespacedView *view.NamespacedView Handler *handler.Handler `json:",omitempty"` SourceURL string // contains filtered or unexported fields }
Component represents abstract API view/handler based component
func NewComponent ¶
func NewComponent(path *contract.Path, options ...ComponentOption) (*Component, error)
func (*Component) GenerateOutputCode ¶
func (*Component) LocatorOptions ¶
func (*Component) LookupParameter ¶ added in v0.10.0
LookupParameter lookups parameter by name
func (*Component) TypeRegistry ¶
type ComponentOption ¶
Component represents abstract API view/handler based component
func WithContract ¶
func WithHandler ¶
func WithHandler(aHandler xhandler.Handler) ComponentOption
func WithInput ¶
func WithInput(inputType reflect.Type) ComponentOption
func WithNamedResources ¶
func WithNamedResources(names ...string) ComponentOption
func WithOutputCaseFormat ¶
func WithOutputCaseFormat(format string) ComponentOption
func WithResource ¶
func WithResource(resource *view.Resource) ComponentOption
func WithView ¶
func WithView(aView *view.View) ComponentOption
type Components ¶
type Components struct { URL string `json:",omitempty" yaml:",omitempty"` Version version.Control With []string //list of resource to inherit from `json:",omitempty"` Components []*Component Resource *view.Resource // contains filtered or unexported fields }
func LoadComponents ¶
func NewComponents ¶
func NewComponents(ctx context.Context, options ...Option) *Components
NewComponents creates components
type Option ¶
type Option func(o *Options)
func WithApiPrefix ¶
func WithCodecs ¶
func WithComponentURL ¶
func WithConstants ¶
func WithCustomAuth ¶ added in v0.9.0
func WithDispatcher ¶
func WithDispatcher(fn func(registry *Registry) contract.Dispatcher) Option
func WithExtensions ¶
WithExtensions returns extension option
func WithIgnorePlugin ¶
func WithJWTSigner ¶
func WithJWTVerifier ¶
func WithMetrics ¶
func WithPackageTypes ¶
func WithPackageTypes(types ...*view.PackagedType) Option
func WithPluginURL ¶
func WithPredicates ¶
func WithPredicates(predicates *extension.PredicateRegistry) Option
func WithRefreshFrequency ¶
func WithResourceURL ¶
func WithResources ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func (*Provider) Namespaces ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(apiPrefix string, newDispatcher func(registry *Registry) contract.Dispatcher) *Registry
func (*Registry) Dispatcher ¶
func (r *Registry) Dispatcher() contract.Dispatcher
func (*Registry) LookupProvider ¶
func (*Registry) SetComponents ¶
func (*Registry) SetProviders ¶
type Resources ¶
type Resources interface { AddResource(key string, aResource *view.Resource) Has(key string) bool Lookup(key string) (*version.Resource, error) Substitutes() map[string]view.Substitutes IsCheckDue(t time.Time) bool SyncChanges(ctx context.Context) (bool, error) }
Resources represents a resource
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AuthService ¶ added in v0.9.0
AuthService returns jwt signer
func (*Service) Extensions ¶
func (*Service) JWTVerifier ¶
JWTVerifier returns jwt signer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.