forked from the-anna-project/annad
/
generated_service.go
54 lines (42 loc) · 1.18 KB
/
generated_service.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
43
44
45
46
47
48
49
50
51
52
53
54
package input
// This file is generated by the CLG generator. Don't edit it manually. The CLG
// generator is invoked by go generate. For more information about the usage of
// the CLG generator check https://github.com/xh3b4sd/clggen or have a look at
// the clg package. There is the go generate statement placed to invoke clggen.
import (
servicespec "github.com/the-anna-project/spec/service"
)
// New creates a new input CLG service.
func New() servicespec.CLGService {
return &service{}
}
type service struct {
// Dependencies.
serviceCollection servicespec.ServiceCollection
// Settings.
metadata map[string]string
}
func (s *service) Boot() {
id, err := s.Service().ID().New()
if err != nil {
panic(err)
}
s.metadata = map[string]string{
"id": id,
"kind": "input",
"name": "clg",
"type": "service",
}
}
func (s *service) GetCalculate() interface{} {
return s.calculate
}
func (s *service) Metadata() map[string]string {
return s.metadata
}
func (s *service) Service() servicespec.ServiceCollection {
return s.serviceCollection
}
func (s *service) SetServiceCollection(serviceCollection servicespec.ServiceCollection) {
s.serviceCollection = serviceCollection
}