From e44882ab61eeaa2ceb47f6d6775e417174d0a9bd Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Wed, 4 Oct 2023 09:26:14 +1000 Subject: [PATCH] Adding missing CloudTag docs. We are missing a lot of documentation around tag getters. This commit adds better docs for Cloud to support pkg.go.dev. --- cloud.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cloud.go b/cloud.go index 04b8b1a..7520bd9 100644 --- a/cloud.go +++ b/cloud.go @@ -15,13 +15,23 @@ var ( validCloud = regexp.MustCompile("^" + cloudSnippet + "$") ) +// CloudTag is a names.Tag the represents a Cloud in the Juju domain. type CloudTag struct { id string } +// String implements Tag.String. func (t CloudTag) String() string { return t.Kind() + "-" + t.id } -func (t CloudTag) Kind() string { return CloudTagKind } -func (t CloudTag) Id() string { return t.id } + +// Kind implements Tag.Kind returning a CloudTag's unique kind value. +func (t CloudTag) Kind() string { return CloudTagKind } + +// Id returns the id of this CloudTag. This is the name of the cloud as +// represented by Juju. Examples: +// aws +// azure +// kubernetes +func (t CloudTag) Id() string { return t.id } // NewCloudTag returns the tag for the cloud with the given ID. // It will panic if the given cloud ID is not valid.