dataservice

package
v2.0.0-...-6831f71 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProvideGRPCCallOptions

func ProvideGRPCCallOptions(
	dataServiceTokenFile string,
) ([]grpc.CallOption, error)

Provide the Call Options for token auth

Types

type DataService

type DataService struct {
	OutputPath string
	// contains filtered or unexported fields
}

func NewDataService

func NewDataService(dataServiceConfig *DataServiceConfig, opts ...grpc.DialOption) (*DataService, error)

func (*DataService) DeleteFile

func (d *DataService) DeleteFile(ctx context.Context, info *dataservicev1.FileInfo) error

func (*DataService) DownloadFile

func (d *DataService) DownloadFile(ctx context.Context, info *dataservicev1.FileInfo) (file string, err error)

func (*DataService) GetFile

func (d *DataService) GetFile(ctx context.Context, id string) (*dataservicev1.FileInfo, error)

func (*DataService) ListFiles

func (d *DataService) ListFiles(ctx context.Context) ([]*dataservicev1.FileInfo, error)

func (*DataService) Name

func (u *DataService) Name() string

func (*DataService) SetCallOpts

func (r *DataService) SetCallOpts(opts ...grpc.CallOption)

Set Call Options for NewStreams, usually for updated token & cert

func (*DataService) UpdateMetadata

func (d *DataService) UpdateMetadata(ctx context.Context, file *dataservicev1.FileInfo) error

func (*DataService) Upload

func (d *DataService) Upload(ctx context.Context, info *dataservicev1.FileInfo, reader io.Reader) (id string, err error)

func (*DataService) UploadFile

func (r *DataService) UploadFile(ctx context.Context, fileName string, reader io.Reader) (string, error)

type DataServiceConfig

type DataServiceConfig struct {
	OutputPath       string   `json:"-"`
	Address          string   `json:"address"`
	DataServiceToken string   `json:"dataServiceToken"`
	DataServiceCert  []byte   `json:"dataServiceCert"`
	CipherSuites     []uint16 `json:"cipherSuites"`
	MinVersion       uint16   `json:"minVersion"`
}

type FileStorage

type FileStorage interface {
	DownloadFile(context.Context, *dataservicev1.FileInfo) (file string, err error)
	ListFiles(context.Context) ([]*dataservicev1.FileInfo, error)
	GetFile(ctx context.Context, id string) (*dataservicev1.FileInfo, error)
	Upload(context.Context, *dataservicev1.FileInfo, io.Reader) (id string, err error)
	UpdateMetadata(context.Context, *dataservicev1.FileInfo) (err error)
	DeleteFile(context.Context, *dataservicev1.FileInfo) error
}

type MeterReportMetadata

type MeterReportMetadata struct {
	ReportName      string `mapstructure:"reportName"`
	ReportNamespace string `mapstructure:"reportNamespace"`
}

func (*MeterReportMetadata) From

func (m *MeterReportMetadata) From(in map[string]string) error

func (*MeterReportMetadata) IsEmpty

func (m *MeterReportMetadata) IsEmpty() bool

func (MeterReportMetadata) Map

func (m MeterReportMetadata) Map() (out map[string]string, err error)

func (*MeterReportMetadata) NamespacedName

func (m *MeterReportMetadata) NamespacedName() types.NamespacedName

Jump to

Keyboard shortcuts

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