systeminfo

package
v0.0.0-...-cc6ace1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Ctl is the default instance of the package

Functions

func OIDCProviderName

func OIDCProviderName(cfg map[string]interface{}) string

Types

type Controller

type Controller interface {

	// GetInfo consolidates the info of the system by checking settings in DB and env vars
	GetInfo(ctx context.Context, opt Options) (*Data, error)

	// GetCapacity returns total and free space of the storage in byte
	GetCapacity(ctx context.Context) (*imagestorage.Capacity, error)

	// GetCA returns a ReadCloser of Harbor's CA if it's configured and accessible from Harbor core
	GetCA(ctx context.Context) (io.ReadCloser, error)
}

Controller defines the methods needed for systeminfo API

func NewController

func NewController() Controller

NewController return an instance of controller

type Data

type Data struct {
	AuthMode          string
	PrimaryAuthMode   bool
	SelfRegistration  bool
	HarborVersion     string
	BannerMessage     string
	AuthProxySettings *models.HTTPAuthProxy
	Protected         *protectedData
	OIDCProviderName  string
}

Data wraps common systeminfo data

type Options

type Options struct {
	// WithProtectedInfo controls if the protected info, which are considered to be sensitive, should be returned
	WithProtectedInfo bool
}

Options provide a set of attributes to control what info should be returned

Jump to

Keyboard shortcuts

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