-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.go
42 lines (33 loc) · 858 Bytes
/
default.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2018 Axel Etcheverry. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package service
var defaultContainer = New()
// SetValue static.
func SetValue(name string, v interface{}) {
defaultContainer.SetValue(name, v)
}
// Set service.
func Set(name string, f ContainerFunc) {
defaultContainer.Set(name, f)
}
// Has service exists.
func Has(name string) bool {
return defaultContainer.Has(name)
}
// Get service.
func Get(name string) interface{} {
return defaultContainer.Get(name)
}
// GetKeys of all services.
func GetKeys() []string {
return defaultContainer.GetKeys()
}
// Fill dst.
func Fill(name string, dst interface{}) {
defaultContainer.Fill(name, dst)
}
// Extend service.
func Extend(name string, f ExtenderFunc) {
defaultContainer.Extend(name, f)
}