image

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ImageExpirationTime define the expiration of the image download URL
	ImageExpirationTime = 4 * time.Hour
)

Variables

This section is empty.

Functions

func GenerateDownloadURLByToken

func GenerateDownloadURLByToken(baseUrl string, source *model.Source) (string, *strfmt.DateTime, error)

func HMACKey

func HMACKey(n int) (string, error)

HMACKey generates a hex string representing n random bytes

This string is intended to be used as a private key for signing and verifying jwt tokens. Specifically ones used for downloading images when using rhsso auth and the image service.

func IdFromJWT

func IdFromJWT(jwt string) (string, error)

func JWTForSymmetricKey

func JWTForSymmetricKey(key []byte, expiration time.Duration, sub string) (string, error)

func ParseExpiration

func ParseExpiration(tokenString string) (*strfmt.DateTime, error)

func ValidateToken

func ValidateToken(ctx context.Context, token string, keyFunc func(token *jwt.Token) (interface{}, error)) error

Types

type IgnitionData

type IgnitionData struct {
	DebugMode            string
	SshKey               string
	PlannerServiceUI     string
	PlannerService       string
	InsecureRegistry     string
	Token                string
	PersistentDiskDevice string
	SourceID             string
	HttpProxyUrl         string
	HttpsProxyUrl        string
	NoProxyDomain        string
	RhcosPassword        string
	IpAddress            string
	SubnetMask           string
	DefaultGateway       string
	Dns                  string
}

IgnitionData defines modifiable fields in ignition config

type ImageBuilder

type ImageBuilder struct {
	SourceID             string
	SshKey               string
	Proxy                Proxy
	CertificateChain     string
	DebugMode            string
	PlannerServiceUI     string
	PlannerService       string
	InsecureRegistry     string
	Token                string
	PersistentDiskDevice string
	PersistentDiskImage  string
	IsoImageName         string
	OvfFile              string
	OvfName              string
	Template             string
	RHCOSImage           string

	RhcosPassword string
	VmNetwork     VmNetwork
	// contains filtered or unexported fields
}

func NewImageBuilder

func NewImageBuilder(sourceID uuid.UUID) *ImageBuilder

func (*ImageBuilder) Generate

func (b *ImageBuilder) Generate(ctx context.Context, w io.Writer) error

func (*ImageBuilder) Size

func (b *ImageBuilder) Size() (int, error)

func (*ImageBuilder) Validate

func (b *ImageBuilder) Validate() error

func (*ImageBuilder) WithAgentToken

func (b *ImageBuilder) WithAgentToken(token string) *ImageBuilder

func (*ImageBuilder) WithCertificateChain

func (b *ImageBuilder) WithCertificateChain(certs string) *ImageBuilder

func (*ImageBuilder) WithImageInfra

func (b *ImageBuilder) WithImageInfra(imageInfra model.ImageInfra) *ImageBuilder

func (*ImageBuilder) WithImageType

func (b *ImageBuilder) WithImageType(imageType ImageType) *ImageBuilder

func (*ImageBuilder) WithInsecureRegistry

func (b *ImageBuilder) WithInsecureRegistry(insecureRegistry string) *ImageBuilder

func (*ImageBuilder) WithIsoImageName

func (b *ImageBuilder) WithIsoImageName(name string) *ImageBuilder

func (*ImageBuilder) WithOvfFile

func (b *ImageBuilder) WithOvfFile(ovfFile string) *ImageBuilder

func (*ImageBuilder) WithOvfName

func (b *ImageBuilder) WithOvfName(ovfName string) *ImageBuilder

func (*ImageBuilder) WithPersistenceDiskDevice

func (b *ImageBuilder) WithPersistenceDiskDevice(persistenceDevice string) *ImageBuilder

func (*ImageBuilder) WithPersistentDiskImage

func (b *ImageBuilder) WithPersistentDiskImage(imagePath string) *ImageBuilder

func (*ImageBuilder) WithPlannerService

func (b *ImageBuilder) WithPlannerService(url string) *ImageBuilder

func (*ImageBuilder) WithPlannerServiceUI

func (b *ImageBuilder) WithPlannerServiceUI(uiUrl string) *ImageBuilder

func (*ImageBuilder) WithProxy

func (b *ImageBuilder) WithProxy(proxy Proxy) *ImageBuilder

func (*ImageBuilder) WithRHCOSImage

func (b *ImageBuilder) WithRHCOSImage(image string) *ImageBuilder

func (*ImageBuilder) WithSshKey

func (b *ImageBuilder) WithSshKey(sshKey string) *ImageBuilder

func (*ImageBuilder) WithTemplate

func (b *ImageBuilder) WithTemplate(templatePath string) *ImageBuilder

func (*ImageBuilder) WithVmNetwork

func (b *ImageBuilder) WithVmNetwork(network VmNetwork) *ImageBuilder

type ImageType

type ImageType int
const (
	OVAImageType ImageType = iota
	QemuImageType
)

type Key

type Key int
const ResponseWriterKey Key = 0

Key to store the ResponseWriter in the context of openapi

type Proxy

type Proxy struct {
	HttpUrl       string
	HttpsUrl      string
	NoProxyDomain string
}

type VmNetwork

type VmNetwork struct {
	IpAddress      string
	SubnetMask     string
	DefaultGateway string
	Dns            string
}

Jump to

Keyboard shortcuts

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