sitemgr

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package sitemgr implements the site manager

Index

Constants

View Source
const (
	// Testuuid1 Test UUID 1
	Testuuid1 = "test-uuid1-1234567890"
)

Variables

View Source
var (
	// ErrSiteNotFound is returned when a site is not found in cloud-site-manager.
	ErrSiteNotFound = errors.New("requested Site was not found in Site Manager")
)

Functions

func CreateSite

func CreateSite(ctx context.Context, logger zerolog.Logger, siteUUID, name, provider, fcOrg, url string) error

CreateSite creates a site in cloud-site-manager. It accepts the minimal fields needed to create a site.

func DeleteSite

func DeleteSite(ctx context.Context, logger zerolog.Logger, uuid, url string) error

DeleteSite deletes a site from cloud-site-manager using its UUID.

func GetSiteOTP

func GetSiteOTP(ctx context.Context, logger zerolog.Logger, uuid, url string) (*string, *time.Time, error)

GetSiteOTP retrieves the OTP and its expiration time for a given site UUID from cloud-site-manager.

func NewCommand

func NewCommand() *cli.Command

NewCommand creates a new cli command

func RollSite

func RollSite(ctx context.Context, logger zerolog.Logger, siteID, siteName, url string) error

RollSite regenerates the bootstrap OTP for a site in cloud-site-manager. Instead of passing a site object, we now pass the necessary fields.

Types

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options are args passed to the site manager at boot

type SiteMgr

type SiteMgr struct {
	Options
	// contains filtered or unexported fields
}

SiteMgr defines an instance of site manager

func NewSiteManager

func NewSiteManager(ctx context.Context, o Options) (*SiteMgr, error)

NewSiteManager creates an instance of SiteMgr

func (*SiteMgr) Start

func (s *SiteMgr) Start(ctx context.Context)

Start starts the manager

type Suite

type Suite struct {
	sync.Mutex

	MgrURL string

	UUID1OTP string
	// contains filtered or unexported fields
}

Suite test instance

func TestManagerCreateSite

func TestManagerCreateSite() (*Suite, error)

TestManagerCreateSite creates the site

func (*Suite) Teardown

func (s *Suite) Teardown()

Teardown closes the connection

func (*Suite) TestManagerSiteTest

func (s *Suite) TestManagerSiteTest() error

TestManagerSiteTest run tests on a site

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL