suse

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Updater) error

Option configures an Updater.

func WithClient

func WithClient(c *http.Client) Option

WithClient sets an http.Client for use with an Updater.

If this Option is not supplied, http.DefaultClient will be used.

func WithLogger

func WithLogger(l *zerolog.Logger) Option

WithLogger sets the default logger.

Functions that take a context.Context will use the logger embedded in there instead of the Logger passed in via this Option.

func WithURL

func WithURL(uri, compression string) Option

WithURL overrides the default URL to fetch an OVAL database.

type Release

type Release string

Release indicates the SUSE release OVAL database to pull from.

const (
	EnterpriseServer15  Release = `suse.linux.enterprise.server.15`
	EnterpriseDesktop15 Release = `suse.linux.enterprise.desktop.15`
	Enterprise15        Release = `suse.linux.enterprise.15`
	EnterpriseServer12  Release = `suse.linux.enterprise.server.12`
	EnterpriseDesktop12 Release = `suse.linux.enterprise.desktop.12`
	Enterprise12        Release = `suse.linux.enterprise.12`
	EnterpriseServer11  Release = `suse.linux.enterprise.server.11`
	EnterpriseDesktop11 Release = `suse.linux.enterprise.desktop.11`
	OpenStackCloud9     Release = `suse.openstack.cloud.9`
	OpenStackCloud8     Release = `suse.openstack.cloud.8`
	OpenStackCloud7     Release = `suse.openstack.cloud.7`
	Leap151             Release = `opensuse.leap.15.1`
	Leap150             Release = `opensuse.leap.15.0`
	Leap423             Release = `opensuse.leap.42.3`
)

These are some known Releases.

type Updater

type Updater struct {
	ovalutil.Fetcher
	// contains filtered or unexported fields
}

Updater implements driver.Updater for SUSE.

func NewUpdater

func NewUpdater(r Release, opts ...Option) (*Updater, error)

NewUpdater configures an updater to fetch the specified Release.

func (*Updater) Fetch

func (u *Updater) Fetch() (io.ReadCloser, string, error)

Fetch satisfies driver.Fetcher.

func (*Updater) Name

func (u *Updater) Name() string

Name satisfies driver.Updater.

func (*Updater) Parse

func (u *Updater) Parse(r io.ReadCloser) ([]*claircore.Vulnerability, error)

Parse satisifies the driver.Updater interface.

func (*Updater) ParseContext

func (u *Updater) ParseContext(ctx context.Context, r io.ReadCloser) ([]*claircore.Vulnerability, error)

ParseContext is like Parse, but with context.

Jump to

Keyboard shortcuts

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