Skip to content

Commit a7329a7

Browse files
committed
godoc
1 parent c413719 commit a7329a7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/inserter/model.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package inserter
22

3+
// Model - JSONやYAMLのモデル
34
type Model struct {
45
Version string `json:"version" yaml:"version"`
56
Items []ModelItem `json:"items" yaml:"version"`
67
}
78

9+
// ModelItem - Modelが持つアイテム
810
type ModelItem struct {
911
Ref string `json:"ref" yaml:"ref"`
1012
Payload map[string]interface{} `json:"payload" yaml:"payload"`

pkg/inserter/yaml_inserter.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ import (
88
"gopkg.in/yaml.v2"
99
)
1010

11+
// YAMLInserter - InserterのYAML実装
1112
type YAMLInserter struct {
1213
ci *CommonInserter
1314
}
1415

16+
// NewYAMLInserter - YAMLInserter constructor
1517
func NewYAMLInserter(ci *CommonInserter) *YAMLInserter {
1618
return &YAMLInserter{
1719
ci: ci,
1820
}
1921
}
2022

23+
// Execute - YAMLを読み込んでアイテムを生成する
2124
func (y *YAMLInserter) Execute(ctx context.Context, cn, path string) error {
2225
yb, err := os.ReadFile(path)
2326
if err != nil {

0 commit comments

Comments
 (0)