summaryrefslogtreecommitdiff
path: root/internal/resource/resource.go
blob: e0bb8268083e6bf62c209a9b335130ac8c18bf53 (plain)
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
package resource

import (
	"fmt"
)

type Resource struct {
	Type      string
	Name      string
	dependsOn map[string]struct{}
}

func New(type_, name string) Resource {
	return Resource{
		Type:      type_,
		Name:      name,
		dependsOn: make(map[string]struct{}),
	}
}

func (r Resource) String() string {
	return r.ID()
}

func (r Resource) ID() string {
	return fmt.Sprintf("%s[%s]", r.Type, r.Name)
}