registration

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RHSMName = "   Red Hat Developers or Red Hat Subscription Management (RHSM)"
)

Variables

View Source
var (
	ErrDetectionFailed = errors.New("Distribution type not recognized to Registration")
)

Functions

func NeedRegistration added in v1.2.0

func NeedRegistration(host *host.Host) (bool, error)

Detect supported Registrator

func Register

func Register(name string, r *RegisteredRegistrator)

func RegisterHostVM

func RegisterHostVM(host *host.Host, param *RegistrationParameters) (bool, error)

Register host VM

func SetDetector

func SetDetector(newDetector Detector)

func UnregisterHostVM

func UnregisterHostVM(host *host.Host, param *RegistrationParameters) (bool, error)

Unregister host VM

Types

type Detector

type Detector interface {
	DetectRegistrator(c provision.SSHCommander) (Registrator, bool, error)
}

type RedHatRegistrator

type RedHatRegistrator struct {
	provision.SSHCommander
}

func (*RedHatRegistrator) CompatibleWithDistribution

func (registrator *RedHatRegistrator) CompatibleWithDistribution(osReleaseInfo *provision.OsRelease) bool

CompatibleWithDistribution returns true if system supports registration with RHSM

func (*RedHatRegistrator) Register

func (registrator *RedHatRegistrator) Register(param *RegistrationParameters) error

Register attempts to register the system with RHSM

func (*RedHatRegistrator) Unregister

func (registrator *RedHatRegistrator) Unregister(param *RegistrationParameters) error

Unregister attempts to unregister the system from RHSM

type RegisteredRegistrator

type RegisteredRegistrator struct {
	New func(c provision.SSHCommander) Registrator
}

RegisteredRegistrator creates a new registrator

type RegistrationHostActionFunc added in v1.4.0

type RegistrationHostActionFunc func(param *RegistrationParameters) error

type RegistrationParameters

type RegistrationParameters struct {
	Username               string
	Password               string
	GetUsernameInteractive func(message string) string
	GetPasswordInteractive func(message string) string
}

type Registrator

type Registrator interface {
	provision.SSHCommander

	// Register
	Register(param *RegistrationParameters) error

	// Return the auth options used to configure remote connection for the daemon.
	Unregister(param *RegistrationParameters) error

	// Figure out whether this is a matching registrar
	CompatibleWithDistribution(osReleaseInfo *provision.OsRelease) bool
}

Registration defines distribution specific actions

func DetectRegistrator

func DetectRegistrator(c provision.SSHCommander) (Registrator, bool, error)

func NewRedHatRegistrator

func NewRedHatRegistrator(c provision.SSHCommander) Registrator

type StandardRegistrator

type StandardRegistrator struct{}

func (StandardRegistrator) DetectRegistrator

func (detector StandardRegistrator) DetectRegistrator(c provision.SSHCommander) (Registrator, bool, error)

Jump to

Keyboard shortcuts

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