data

package
v2.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

README

Generating proto files

Installation

Follow instructions here to install necessary binaries.

Compile

Run make build-proto to compile proto.

Documentation

Overview

Package data contains util fns for reading and writing data handled by the cron job.

Index

Constants

This section is empty.

Variables

View Source
var File_cron_data_metadata_proto protoreflect.FileDescriptor
View Source
var File_cron_data_request_proto protoreflect.FileDescriptor

Functions

func BlobExists

func BlobExists(ctx context.Context, bucketURL, key string) (bool, error)

BlobExists checks whether a given `bucketURL/key` blob exists.

func GetBlobContent

func GetBlobContent(ctx context.Context, bucketURL, key string) ([]byte, error)

GetBlobContent returns the file content given a bucketURL and object key.

func GetBlobFilename

func GetBlobFilename(filename string, datetime time.Time) string

GetBlobFilename returns a blob key for a shard. Takes Time object and filename as input.

func GetBlobKeys

func GetBlobKeys(ctx context.Context, bucketURL string) ([]string, error)

GetBlobKeys returns all object keys for a given bucketURL.

func GetShardMetadataFilename added in v2.1.3

func GetShardMetadataFilename(datetime time.Time) string

GetShardMetadataFilename returns shard_metadata filename for a shard.

func GetShardNumFilename

func GetShardNumFilename(datetime time.Time) string

GetShardNumFilename returns shard_num filename for a shard.

func GetTransferStatusFilename

func GetTransferStatusFilename(datetime time.Time) string

GetTransferStatusFilename returns transfer_status filename for a shard.

func ParseBlobFilename

func ParseBlobFilename(key string) (time.Time, string, error)

ParseBlobFilename parses a blob key into a Time object.

func SortAndAppendFrom

func SortAndAppendFrom(in io.Reader, out io.Writer, newRepos []repos.RepoURL) error

SortAndAppendFrom reads from `in`, appends to newRepos and writes the sorted output to `out`.

func SortAndAppendTo

func SortAndAppendTo(out io.Writer, oldRepos, newRepos []repos.RepoURL) error

SortAndAppendTo appends `oldRepos` and `newRepos` before sorting and writing out the result to `out`.

func WriteToBlobStore

func WriteToBlobStore(ctx context.Context, bucketURL, filename string, data []byte) error

WriteToBlobStore creates and writes data to filename in bucketURL.

Types

type Iterator

type Iterator interface {
	HasNext() bool
	Next() (repos.RepoURL, error)
}

Iterator interface is used to iterate through list of input repos for the cron job.

func MakeIteratorFrom

func MakeIteratorFrom(reader io.Reader) (Iterator, error)

MakeIteratorFrom returns an implementation of Iterator interface. Currently returns an instance of csvIterator.

type ScorecardBatchRequest

type ScorecardBatchRequest struct {
	Repos    []string               `protobuf:"bytes,1,rep,name=repos,proto3" json:"repos,omitempty"`
	ShardNum *int32                 `protobuf:"varint,2,opt,name=shard_num,json=shardNum,proto3,oneof" json:"shard_num,omitempty"`
	JobTime  *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=job_time,json=jobTime,proto3,oneof" json:"job_time,omitempty"`
	// contains filtered or unexported fields
}

func (*ScorecardBatchRequest) Descriptor deprecated

func (*ScorecardBatchRequest) Descriptor() ([]byte, []int)

Deprecated: Use ScorecardBatchRequest.ProtoReflect.Descriptor instead.

func (*ScorecardBatchRequest) GetJobTime

func (x *ScorecardBatchRequest) GetJobTime() *timestamppb.Timestamp

func (*ScorecardBatchRequest) GetRepos

func (x *ScorecardBatchRequest) GetRepos() []string

func (*ScorecardBatchRequest) GetShardNum

func (x *ScorecardBatchRequest) GetShardNum() int32

func (*ScorecardBatchRequest) ProtoMessage

func (*ScorecardBatchRequest) ProtoMessage()

func (*ScorecardBatchRequest) ProtoReflect

func (x *ScorecardBatchRequest) ProtoReflect() protoreflect.Message

func (*ScorecardBatchRequest) Reset

func (x *ScorecardBatchRequest) Reset()

func (*ScorecardBatchRequest) String

func (x *ScorecardBatchRequest) String() string

type ShardMetadata added in v2.1.3

type ShardMetadata struct {
	ShardLoc  *string `protobuf:"bytes,1,opt,name=shard_loc,json=shardLoc,proto3,oneof" json:"shard_loc,omitempty"`
	NumShard  *int32  `protobuf:"varint,2,opt,name=num_shard,json=numShard,proto3,oneof" json:"num_shard,omitempty"`
	CommitSha *string `protobuf:"bytes,3,opt,name=commit_sha,json=commitSha,proto3,oneof" json:"commit_sha,omitempty"`
	// contains filtered or unexported fields
}

func (*ShardMetadata) Descriptor deprecated added in v2.1.3

func (*ShardMetadata) Descriptor() ([]byte, []int)

Deprecated: Use ShardMetadata.ProtoReflect.Descriptor instead.

func (*ShardMetadata) GetCommitSha added in v2.1.3

func (x *ShardMetadata) GetCommitSha() string

func (*ShardMetadata) GetNumShard added in v2.1.3

func (x *ShardMetadata) GetNumShard() int32

func (*ShardMetadata) GetShardLoc added in v2.1.3

func (x *ShardMetadata) GetShardLoc() string

func (*ShardMetadata) ProtoMessage added in v2.1.3

func (*ShardMetadata) ProtoMessage()

func (*ShardMetadata) ProtoReflect added in v2.1.3

func (x *ShardMetadata) ProtoReflect() protoreflect.Message

func (*ShardMetadata) Reset added in v2.1.3

func (x *ShardMetadata) Reset()

func (*ShardMetadata) String added in v2.1.3

func (x *ShardMetadata) String() string

Directories

Path Synopsis
Package main adds new project repositories to the projects file.
Package main adds new project repositories to the projects file.
Package main updates projects repositories with a projects dependencies.
Package main updates projects repositories with a projects dependencies.
Package main validates an input file with a list of projects.
Package main validates an input file with a list of projects.

Jump to

Keyboard shortcuts

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