sources

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IncludeDeleted string = "includeDeleted"
	BeforeDate            = "beforeDate"
	AfterDate             = "afterDate"
	DryRun                = "dryRun"
)
View Source
const (
	StartDate = "startDate"
	EndDate   = "endDate"
	EMPTY     = ""
)

Variables

This section is empty.

Functions

func CreateFileFromString

func CreateFileFromString(outFile string, data string) error

Creates file with given data content

func Tar

func Tar(src string, writers ...io.Writer) error

Types

type CommitableSource

type CommitableSource interface {
	Source
	Commit(
		ctx context.Context,
		currentMeteringExport *api.MeteringExport,
		bundle *bundle.BundleFile,
		opts GenericOptions,
	) (count int, err error)
}

func NewDataService

func NewDataService(
	dataService dataservice.Client,
	printer printers.TablePrinter,
) (CommitableSource, error)

type Factory

type Factory interface {
	FromSource(source api.Source) (Source, error)
}

type GenericOptions

type GenericOptions interface {
	GetString(string) (string, bool, error)
	GetInt(string) (int, bool, error)
	GetBool(string) (bool, bool, error)
	GetTime(string) (time.Time, bool, error)
	Get(string) (interface{}, bool, error)
}

func EmptyOptions

func EmptyOptions() GenericOptions

func NewDataServiceOptions

func NewDataServiceOptions(includeDeleted bool, beforeDate, afterDate time.Time, dryRun bool) GenericOptions

func NewOptions

func NewOptions(key string, value interface{}, fields ...interface{}) GenericOptions

type Options

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

func (*Options) Get

func (o *Options) Get(name string) (interface{}, bool, error)

func (*Options) GetBool

func (o *Options) GetBool(name string) (bool, bool, error)

func (*Options) GetInt

func (o *Options) GetInt(name string) (int, bool, error)

func (*Options) GetString

func (o *Options) GetString(name string) (string, bool, error)

func (*Options) GetTime

func (o *Options) GetTime(name string) (time.Time, bool, error)

type Source

type Source interface {
	Pull(
		ctx context.Context,
		currentMeteringExport *api.MeteringExport,
		bundle *bundle.BundleFile,
		options GenericOptions,
	) (count int, err error)

	GetResponse() string
}

func NewIlmtSource

func NewIlmtSource(
	ilmt ilmt.Client,
	printer printers.TablePrinter,
) (Source, error)

type SourceFactoryBuilder

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

func (*SourceFactoryBuilder) Build

func (s *SourceFactoryBuilder) Build() Factory

func (*SourceFactoryBuilder) SetConfigFlags

func (s *SourceFactoryBuilder) SetConfigFlags(rhmConfigFlags *config.ConfigFlags) *SourceFactoryBuilder

func (*SourceFactoryBuilder) SetPrinter

Jump to

Keyboard shortcuts

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