generator

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var C = func(i interface{}) *Container {
	if c, ok := i.(*Container); ok {
		return c
	}
	r, ok := i.(*http.Request)
	if !ok {
		panic("could not get the container with dic.C()")
	}
	c, ok := r.Context().Value(dingo.ContainerKey("dingo")).(*Container)
	if !ok {
		panic("could not get the container from the given *http.Request in dic.C()")
	}
	return c
}

C retrieves a Container from an interface. The function panics if the Container can not be retrieved.

The interface can be :

  • a *Container
  • an *http.Request containing a *Container in its context.Context for the dingo.ContainerKey("dingo") key.

The function can be changed to match the needs of your application.

Functions

func BimaGeneratorDic

func BimaGeneratorDic(i interface{}) *generators.Dic

BimaGeneratorDic retrieves the "bima:generator:dic" object from the generator scope.

---------------------------------------------

name: "bima:generator:dic"
type: *generators.Dic
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaGeneratorDic method. If the container can not be retrieved, it panics.

func BimaGeneratorModel

func BimaGeneratorModel(i interface{}) *generators.Model

BimaGeneratorModel retrieves the "bima:generator:model" object from the generator scope.

---------------------------------------------

name: "bima:generator:model"
type: *generators.Model
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaGeneratorModel method. If the container can not be retrieved, it panics.

func BimaGeneratorModule

func BimaGeneratorModule(i interface{}) *generators.Module

BimaGeneratorModule retrieves the "bima:generator:module" object from the generator scope.

---------------------------------------------

name: "bima:generator:module"
type: *generators.Module
scope: "generator"
build: struct
params:
	- "Config": Value([]string)
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaGeneratorModule method. If the container can not be retrieved, it panics.

func BimaGeneratorProto

func BimaGeneratorProto(i interface{}) *generators.Proto

BimaGeneratorProto retrieves the "bima:generator:proto" object from the generator scope.

---------------------------------------------

name: "bima:generator:proto"
type: *generators.Proto
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaGeneratorProto method. If the container can not be retrieved, it panics.

func BimaGeneratorProvider

func BimaGeneratorProvider(i interface{}) *generators.Provider

BimaGeneratorProvider retrieves the "bima:generator:provider" object from the generator scope.

---------------------------------------------

name: "bima:generator:provider"
type: *generators.Provider
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaGeneratorProvider method. If the container can not be retrieved, it panics.

func BimaGeneratorServer

func BimaGeneratorServer(i interface{}) *generators.Server

BimaGeneratorServer retrieves the "bima:generator:server" object from the generator scope.

---------------------------------------------

name: "bima:generator:server"
type: *generators.Server
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaGeneratorServer method. If the container can not be retrieved, it panics.

func BimaGeneratorSwagger

func BimaGeneratorSwagger(i interface{}) *generators.Swagger

BimaGeneratorSwagger retrieves the "bima:generator:swagger" object from the generator scope.

---------------------------------------------

name: "bima:generator:swagger"
type: *generators.Swagger
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaGeneratorSwagger method. If the container can not be retrieved, it panics.

func BimaModuleGenerator

func BimaModuleGenerator(i interface{}) *generators.Factory

BimaModuleGenerator retrieves the "bima:module:generator" object from the generator scope.

---------------------------------------------

name: "bima:module:generator"
type: *generators.Factory
scope: "generator"
build: func
params:
	- "0": Service(generators.Generator) ["bima:generator:dic"]
	- "1": Service(generators.Generator) ["bima:generator:model"]
	- "2": Service(generators.Generator) ["bima:generator:module"]
	- "3": Service(generators.Generator) ["bima:generator:proto"]
	- "4": Service(generators.Generator) ["bima:generator:provider"]
	- "5": Service(generators.Generator) ["bima:generator:server"]
	- "6": Service(generators.Generator) ["bima:generator:swagger"]
unshared: false
close: false

---------------------------------------------

It tries to find the container with the C method and the given interface. If the container can be retrieved, it calls the GetBimaModuleGenerator method. If the container can not be retrieved, it panics.

func NewBuilder

func NewBuilder(scopes ...string) (*builder, error)

NewBuilder creates a builder that can be used to create a Container. You probably should use NewContainer to create the container directly. But using NewBuilder allows you to redefine some di services. This can be used for testing. But this behavior is not safe, so be sure to know what you are doing.

Types

type Container

type Container struct {
	// contains filtered or unexported fields
}

Container represents a generated dependency injection container. It is a wrapper around a di.Container.

A Container has a scope and may have a parent in a more generic scope and children in a more specific scope. Objects can be retrieved from the Container. If the requested object does not already exist in the Container, it is built thanks to the object definition. The following attempts to get this object will return the same object.

func NewContainer

func NewContainer(scopes ...string) (*Container, error)

NewContainer creates a new Container. If no scope is provided, di.App, di.Request and di.SubRequest are used. The returned Container has the most generic scope (di.App). The SubContainer() method should be called to get a Container in a more specific scope.

func (*Container) Clean

func (c *Container) Clean() error

Clean deletes the sub-container created by UnscopedSafeGet, UnscopedGet or UnscopedFill.

func (*Container) Delete

func (c *Container) Delete() error

Delete works like DeleteWithSubContainers if the Container does not have any child. But if the Container has sub-containers, it will not be deleted right away. The deletion only occurs when all the sub-containers have been deleted manually. So you have to call Delete or DeleteWithSubContainers on all the sub-containers.

func (*Container) DeleteWithSubContainers

func (c *Container) DeleteWithSubContainers() error

DeleteWithSubContainers takes all the objects saved in this Container and calls the Close function of their Definition on them. It will also call DeleteWithSubContainers on each child and remove its reference in the parent Container. After deletion, the Container can no longer be used. The sub-containers are deleted even if they are still used in other goroutines. It can cause errors. You may want to use the Delete method instead.

func (*Container) Fill

func (c *Container) Fill(name string, dst interface{}) error

Fill is similar to SafeGet but it does not return the object. Instead it fills the provided object with the value returned by SafeGet. The provided object must be a pointer to the value returned by SafeGet.

func (*Container) Get

func (c *Container) Get(name string) interface{}

Get is similar to SafeGet but it does not return the error. Instead it panics.

func (*Container) GetBimaGeneratorDic

func (c *Container) GetBimaGeneratorDic() *generators.Dic

GetBimaGeneratorDic retrieves the "bima:generator:dic" object from the generator scope.

---------------------------------------------

name: "bima:generator:dic"
type: *generators.Dic
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) GetBimaGeneratorModel

func (c *Container) GetBimaGeneratorModel() *generators.Model

GetBimaGeneratorModel retrieves the "bima:generator:model" object from the generator scope.

---------------------------------------------

name: "bima:generator:model"
type: *generators.Model
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) GetBimaGeneratorModule

func (c *Container) GetBimaGeneratorModule() *generators.Module

GetBimaGeneratorModule retrieves the "bima:generator:module" object from the generator scope.

---------------------------------------------

name: "bima:generator:module"
type: *generators.Module
scope: "generator"
build: struct
params:
	- "Config": Value([]string)
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) GetBimaGeneratorProto

func (c *Container) GetBimaGeneratorProto() *generators.Proto

GetBimaGeneratorProto retrieves the "bima:generator:proto" object from the generator scope.

---------------------------------------------

name: "bima:generator:proto"
type: *generators.Proto
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) GetBimaGeneratorProvider

func (c *Container) GetBimaGeneratorProvider() *generators.Provider

GetBimaGeneratorProvider retrieves the "bima:generator:provider" object from the generator scope.

---------------------------------------------

name: "bima:generator:provider"
type: *generators.Provider
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) GetBimaGeneratorServer

func (c *Container) GetBimaGeneratorServer() *generators.Server

GetBimaGeneratorServer retrieves the "bima:generator:server" object from the generator scope.

---------------------------------------------

name: "bima:generator:server"
type: *generators.Server
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) GetBimaGeneratorSwagger

func (c *Container) GetBimaGeneratorSwagger() *generators.Swagger

GetBimaGeneratorSwagger retrieves the "bima:generator:swagger" object from the generator scope.

---------------------------------------------

name: "bima:generator:swagger"
type: *generators.Swagger
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) GetBimaModuleGenerator

func (c *Container) GetBimaModuleGenerator() *generators.Factory

GetBimaModuleGenerator retrieves the "bima:module:generator" object from the generator scope.

---------------------------------------------

name: "bima:module:generator"
type: *generators.Factory
scope: "generator"
build: func
params:
	- "0": Service(generators.Generator) ["bima:generator:dic"]
	- "1": Service(generators.Generator) ["bima:generator:model"]
	- "2": Service(generators.Generator) ["bima:generator:module"]
	- "3": Service(generators.Generator) ["bima:generator:proto"]
	- "4": Service(generators.Generator) ["bima:generator:provider"]
	- "5": Service(generators.Generator) ["bima:generator:server"]
	- "6": Service(generators.Generator) ["bima:generator:swagger"]
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it panics.

func (*Container) IsClosed

func (c *Container) IsClosed() bool

IsClosed returns true if the Container has been deleted.

func (*Container) Parent

func (c *Container) Parent() *Container

Parent returns the parent Container.

func (*Container) ParentScopes

func (c *Container) ParentScopes() []string

ParentScopes returns the list of scopes wider than the Container scope.

func (*Container) SafeGet

func (c *Container) SafeGet(name string) (interface{}, error)

SafeGet retrieves an object from the Container. The object has to belong to this scope or a more generic one. If the object does not already exist, it is created and saved in the Container. If the object can not be created, it returns an error.

func (*Container) SafeGetBimaGeneratorDic

func (c *Container) SafeGetBimaGeneratorDic() (*generators.Dic, error)

SafeGetBimaGeneratorDic retrieves the "bima:generator:dic" object from the generator scope.

---------------------------------------------

name: "bima:generator:dic"
type: *generators.Dic
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) SafeGetBimaGeneratorModel

func (c *Container) SafeGetBimaGeneratorModel() (*generators.Model, error)

SafeGetBimaGeneratorModel retrieves the "bima:generator:model" object from the generator scope.

---------------------------------------------

name: "bima:generator:model"
type: *generators.Model
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) SafeGetBimaGeneratorModule

func (c *Container) SafeGetBimaGeneratorModule() (*generators.Module, error)

SafeGetBimaGeneratorModule retrieves the "bima:generator:module" object from the generator scope.

---------------------------------------------

name: "bima:generator:module"
type: *generators.Module
scope: "generator"
build: struct
params:
	- "Config": Value([]string)
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) SafeGetBimaGeneratorProto

func (c *Container) SafeGetBimaGeneratorProto() (*generators.Proto, error)

SafeGetBimaGeneratorProto retrieves the "bima:generator:proto" object from the generator scope.

---------------------------------------------

name: "bima:generator:proto"
type: *generators.Proto
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) SafeGetBimaGeneratorProvider

func (c *Container) SafeGetBimaGeneratorProvider() (*generators.Provider, error)

SafeGetBimaGeneratorProvider retrieves the "bima:generator:provider" object from the generator scope.

---------------------------------------------

name: "bima:generator:provider"
type: *generators.Provider
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) SafeGetBimaGeneratorServer

func (c *Container) SafeGetBimaGeneratorServer() (*generators.Server, error)

SafeGetBimaGeneratorServer retrieves the "bima:generator:server" object from the generator scope.

---------------------------------------------

name: "bima:generator:server"
type: *generators.Server
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) SafeGetBimaGeneratorSwagger

func (c *Container) SafeGetBimaGeneratorSwagger() (*generators.Swagger, error)

SafeGetBimaGeneratorSwagger retrieves the "bima:generator:swagger" object from the generator scope.

---------------------------------------------

name: "bima:generator:swagger"
type: *generators.Swagger
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) SafeGetBimaModuleGenerator

func (c *Container) SafeGetBimaModuleGenerator() (*generators.Factory, error)

SafeGetBimaModuleGenerator retrieves the "bima:module:generator" object from the generator scope.

---------------------------------------------

name: "bima:module:generator"
type: *generators.Factory
scope: "generator"
build: func
params:
	- "0": Service(generators.Generator) ["bima:generator:dic"]
	- "1": Service(generators.Generator) ["bima:generator:model"]
	- "2": Service(generators.Generator) ["bima:generator:module"]
	- "3": Service(generators.Generator) ["bima:generator:proto"]
	- "4": Service(generators.Generator) ["bima:generator:provider"]
	- "5": Service(generators.Generator) ["bima:generator:server"]
	- "6": Service(generators.Generator) ["bima:generator:swagger"]
unshared: false
close: false

---------------------------------------------

If the object can not be retrieved, it returns an error.

func (*Container) Scope

func (c *Container) Scope() string

Scope returns the Container scope.

func (*Container) Scopes

func (c *Container) Scopes() []string

Scopes returns the list of available scopes.

func (*Container) SubContainer

func (c *Container) SubContainer() (*Container, error)

SubContainer creates a new Container in the next sub-scope that will have this Container as parent.

func (*Container) SubScopes

func (c *Container) SubScopes() []string

SubScopes returns the list of scopes that are more specific than the Container scope.

func (*Container) UnscopedFill

func (c *Container) UnscopedFill(name string, dst interface{}) error

UnscopedFill is similar to UnscopedSafeGet but copies the object in dst instead of returning it.

func (*Container) UnscopedGet

func (c *Container) UnscopedGet(name string) interface{}

UnscopedGet is similar to UnscopedSafeGet but it does not return the error. Instead it panics.

func (*Container) UnscopedGetBimaGeneratorDic

func (c *Container) UnscopedGetBimaGeneratorDic() *generators.Dic

UnscopedGetBimaGeneratorDic retrieves the "bima:generator:dic" object from the generator scope.

---------------------------------------------

name: "bima:generator:dic"
type: *generators.Dic
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedGetBimaGeneratorModel

func (c *Container) UnscopedGetBimaGeneratorModel() *generators.Model

UnscopedGetBimaGeneratorModel retrieves the "bima:generator:model" object from the generator scope.

---------------------------------------------

name: "bima:generator:model"
type: *generators.Model
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedGetBimaGeneratorModule

func (c *Container) UnscopedGetBimaGeneratorModule() *generators.Module

UnscopedGetBimaGeneratorModule retrieves the "bima:generator:module" object from the generator scope.

---------------------------------------------

name: "bima:generator:module"
type: *generators.Module
scope: "generator"
build: struct
params:
	- "Config": Value([]string)
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedGetBimaGeneratorProto

func (c *Container) UnscopedGetBimaGeneratorProto() *generators.Proto

UnscopedGetBimaGeneratorProto retrieves the "bima:generator:proto" object from the generator scope.

---------------------------------------------

name: "bima:generator:proto"
type: *generators.Proto
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedGetBimaGeneratorProvider

func (c *Container) UnscopedGetBimaGeneratorProvider() *generators.Provider

UnscopedGetBimaGeneratorProvider retrieves the "bima:generator:provider" object from the generator scope.

---------------------------------------------

name: "bima:generator:provider"
type: *generators.Provider
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedGetBimaGeneratorServer

func (c *Container) UnscopedGetBimaGeneratorServer() *generators.Server

UnscopedGetBimaGeneratorServer retrieves the "bima:generator:server" object from the generator scope.

---------------------------------------------

name: "bima:generator:server"
type: *generators.Server
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedGetBimaGeneratorSwagger

func (c *Container) UnscopedGetBimaGeneratorSwagger() *generators.Swagger

UnscopedGetBimaGeneratorSwagger retrieves the "bima:generator:swagger" object from the generator scope.

---------------------------------------------

name: "bima:generator:swagger"
type: *generators.Swagger
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedGetBimaModuleGenerator

func (c *Container) UnscopedGetBimaModuleGenerator() *generators.Factory

UnscopedGetBimaModuleGenerator retrieves the "bima:module:generator" object from the generator scope.

---------------------------------------------

name: "bima:module:generator"
type: *generators.Factory
scope: "generator"
build: func
params:
	- "0": Service(generators.Generator) ["bima:generator:dic"]
	- "1": Service(generators.Generator) ["bima:generator:model"]
	- "2": Service(generators.Generator) ["bima:generator:module"]
	- "3": Service(generators.Generator) ["bima:generator:proto"]
	- "4": Service(generators.Generator) ["bima:generator:provider"]
	- "5": Service(generators.Generator) ["bima:generator:server"]
	- "6": Service(generators.Generator) ["bima:generator:swagger"]
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it panics.

func (*Container) UnscopedSafeGet

func (c *Container) UnscopedSafeGet(name string) (interface{}, error)

UnscopedSafeGet retrieves an object from the Container, like SafeGet. The difference is that the object can be retrieved even if it belongs to a more specific scope. To do so, UnscopedSafeGet creates a sub-container. When the created object is no longer needed, it is important to use the Clean method to delete this sub-container.

func (*Container) UnscopedSafeGetBimaGeneratorDic

func (c *Container) UnscopedSafeGetBimaGeneratorDic() (*generators.Dic, error)

UnscopedSafeGetBimaGeneratorDic retrieves the "bima:generator:dic" object from the generator scope.

---------------------------------------------

name: "bima:generator:dic"
type: *generators.Dic
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

func (*Container) UnscopedSafeGetBimaGeneratorModel

func (c *Container) UnscopedSafeGetBimaGeneratorModel() (*generators.Model, error)

UnscopedSafeGetBimaGeneratorModel retrieves the "bima:generator:model" object from the generator scope.

---------------------------------------------

name: "bima:generator:model"
type: *generators.Model
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

func (*Container) UnscopedSafeGetBimaGeneratorModule

func (c *Container) UnscopedSafeGetBimaGeneratorModule() (*generators.Module, error)

UnscopedSafeGetBimaGeneratorModule retrieves the "bima:generator:module" object from the generator scope.

---------------------------------------------

name: "bima:generator:module"
type: *generators.Module
scope: "generator"
build: struct
params:
	- "Config": Value([]string)
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

func (*Container) UnscopedSafeGetBimaGeneratorProto

func (c *Container) UnscopedSafeGetBimaGeneratorProto() (*generators.Proto, error)

UnscopedSafeGetBimaGeneratorProto retrieves the "bima:generator:proto" object from the generator scope.

---------------------------------------------

name: "bima:generator:proto"
type: *generators.Proto
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

func (*Container) UnscopedSafeGetBimaGeneratorProvider

func (c *Container) UnscopedSafeGetBimaGeneratorProvider() (*generators.Provider, error)

UnscopedSafeGetBimaGeneratorProvider retrieves the "bima:generator:provider" object from the generator scope.

---------------------------------------------

name: "bima:generator:provider"
type: *generators.Provider
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

func (*Container) UnscopedSafeGetBimaGeneratorServer

func (c *Container) UnscopedSafeGetBimaGeneratorServer() (*generators.Server, error)

UnscopedSafeGetBimaGeneratorServer retrieves the "bima:generator:server" object from the generator scope.

---------------------------------------------

name: "bima:generator:server"
type: *generators.Server
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

func (*Container) UnscopedSafeGetBimaGeneratorSwagger

func (c *Container) UnscopedSafeGetBimaGeneratorSwagger() (*generators.Swagger, error)

UnscopedSafeGetBimaGeneratorSwagger retrieves the "bima:generator:swagger" object from the generator scope.

---------------------------------------------

name: "bima:generator:swagger"
type: *generators.Swagger
scope: "generator"
build: struct
params: nil
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

func (*Container) UnscopedSafeGetBimaModuleGenerator

func (c *Container) UnscopedSafeGetBimaModuleGenerator() (*generators.Factory, error)

UnscopedSafeGetBimaModuleGenerator retrieves the "bima:module:generator" object from the generator scope.

---------------------------------------------

name: "bima:module:generator"
type: *generators.Factory
scope: "generator"
build: func
params:
	- "0": Service(generators.Generator) ["bima:generator:dic"]
	- "1": Service(generators.Generator) ["bima:generator:model"]
	- "2": Service(generators.Generator) ["bima:generator:module"]
	- "3": Service(generators.Generator) ["bima:generator:proto"]
	- "4": Service(generators.Generator) ["bima:generator:provider"]
	- "5": Service(generators.Generator) ["bima:generator:server"]
	- "6": Service(generators.Generator) ["bima:generator:swagger"]
unshared: false
close: false

---------------------------------------------

This method can be called even if generator is a sub-scope of the container. If the object can not be retrieved, it returns an error.

Jump to

Keyboard shortcuts

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