Documentation
¶
Overview ¶
******************************************************************************
- Copyright 2019 Dell Inc. *
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- in compliance with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software distributed under the License
- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- or implied. See the License for the specific language governing permissions and limitations under
- the License. ******************************************************************************
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TypeInstanceToName ¶
func TypeInstanceToName(v interface{}) string
TypeInstanceToName converts an instance of a type to a unique name.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a receiver that maintains a list of services, their constructors, and their constructed instances in a thread-safe manner.
var GContainer *Container
func NewContainer ¶
func NewContainer(serviceConstructors ServiceConstructorMap) *Container
NewContainer is a factory method that returns an initialized Container receiver struct.
func (*Container) Update ¶
func (c *Container) Update(serviceConstructors ServiceConstructorMap)
Set updates its internal serviceMap with the contents of the provided ServiceConstructorMap.
type ServiceConstructor ¶
type ServiceConstructor func(get Get) interface{}
ServiceConstructor defines the contract for a function/closure to create a service.
type ServiceConstructorMap ¶
type ServiceConstructorMap map[string]ServiceConstructor
ServiceConstructorMap maps a service name to a function/closure to create that service.
Click to show internal directories.
Click to hide internal directories.