Skip to content

Commit

Permalink
Merge pull request #111 from tlm/better-docs
Browse files Browse the repository at this point in the history
Adding missing CloudTag docs.
  • Loading branch information
tlm authored Oct 4, 2023
2 parents d77cb46 + e44882a commit 3f671f1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3f671f1

Please sign in to comment.