-
Notifications
You must be signed in to change notification settings - Fork 3
/
interface.go
33 lines (28 loc) · 983 Bytes
/
interface.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
// Copyright 2018 ekino. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package godim
// Initializer interface to implement if you need specific initialization
//
// OnInit will be called after Injection phase
type Initializer interface {
OnInit() error
}
// Closer interface to implement if you need specific closing method
//
// OnClose will be called on close phase
type Closer interface {
OnClose() error
}
// Identifier interface to implement if you want to name your service.
//
// Key is the key name that will reference it in the other service
type Identifier interface {
Key() string
}
// Prioritizer interface to implement if you want to change the initialization order of your service.
//
// Priority is the score that will determine when this service will be instantiated comparing to the others. Default priority is 0. Lower is sooner.
type Prioritizer interface {
Priority() int
}