Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
Go
Raw Permalink Normal View History

// Copyright IBM Corp. 2020, 2026
2023-02-02 17:15:17 -08:00
// SPDX-License-Identifier: BUSL-1.1
2020-05-27 18:16:43 -04:00
package static_test
import (
"context"
2020-05-27 18:16:43 -04:00
"fmt"
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/host/static"
2020-05-27 18:16:43 -04:00
)
func ExampleNewHostCatalog() {
projectPublicId := "p_1234"
catalog, _ := static.NewHostCatalog(context.Background(), projectPublicId, static.WithName("my catalog"))
2020-05-27 18:16:43 -04:00
fmt.Println(catalog.Name)
// Output:
// my catalog
}
func ExampleNewHost() {
2020-08-25 00:21:08 -04:00
catalogPublicId := "hcst_1234"
host, _ := static.NewHost(context.Background(), catalogPublicId, static.WithAddress("127.0.0.1"))
2020-05-27 18:16:43 -04:00
fmt.Println(host.Address)
// Output:
// 127.0.0.1
}
func ExampleNewHostSet() {
2020-08-25 00:21:08 -04:00
catalogPublicId := "hcst_1234"
set, _ := static.NewHostSet(context.Background(), catalogPublicId, static.WithName("my host set"))
2020-05-27 18:16:43 -04:00
fmt.Println(set.Name)
// Output:
// my host set
}
func ExampleNewHostSetMember() {
2020-08-25 00:21:08 -04:00
setPublicId := "hsst_11111"
hostPublicId := "hst_22222"
member, _ := static.NewHostSetMember(context.Background(), setPublicId, hostPublicId)
fmt.Println(member.SetId)
fmt.Println(member.HostId)
2020-05-27 18:16:43 -04:00
}