Files
threshold/internal/host/static/doc.go
T
429247f407 [COMPLIANCE] Update Copyright Headers (#6282)
* [COMPLIANCE] Update Copyright and License Headers

* chore: make gen to generate files with copyright headers

* chore: update missed copyright headers

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Justin Nguyen <justin.nguyen@hashicorp.com>
2026-01-28 11:05:07 -06:00

38 lines
1.4 KiB
Go

// Copyright IBM Corp. 2020, 2025
// SPDX-License-Identifier: BUSL-1.1
// Package static provides a host, a host catalog, and a host set suitable
// for hosts with a static address.
//
// A host catalog contains a collection of hosts with static addresses.
// These hosts can be grouped into host sets allowing them to be used in a
// target. Hosts and host sets are owned by a single host catalog. If a
// host catalog is deleted, all hosts and host sets owned by it are also
// deleted. A host set contains references to zero or more hosts but does
// not own them. Deleting a host set does not effect any of the hosts it
// referenced. A host set can only reference hosts from the host catalog
// that owns it. Host addresses must be unique within a host catalog.
//
// # Repository
//
// A repository provides methods for creating, updating, retrieving, and
// deleting host catalogs, host sets, and hosts. A new repository should be
// created for each transaction. For example:
//
// var wrapper wrapping.Wrapper
// ... init wrapper...
//
// // db implements both the reader and writer interfaces.
// db, _ := db.Open(db.Postgres, url)
//
// var repo *static.Repository
//
// repo, _ = static.NewRepository(db, db, wrapper)
// catalog, _ := repo.LookupCatalog(ctx, catalogId)
//
// catalog.Name = "new name"
//
// repo, _ = static.NewRepository(db, db, wrapper)
// catalog, _ := repo.UpdateCatalog(ctx, catalog, []string{"Name"})
package static