dataset

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commits = bigquery.TableMetadata{
	Name: "commits",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "created_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "login", Type: bigquery.StringFieldType, Required: true},
		{Name: "sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "message", Type: bigquery.StringFieldType, Required: true},
		{Name: "created_at", Type: bigquery.TimestampFieldType, Required: true},
	},
}
View Source
var Events = bigquery.TableMetadata{
	Name: "events",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "created_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "login", Type: bigquery.StringFieldType, Required: true},
		{Name: "id", Type: bigquery.StringFieldType, Required: true},
		{Name: "type", Type: bigquery.StringFieldType, Required: true},
		{Name: "raw_payload", Type: bigquery.StringFieldType, Required: true},
		{Name: "created_at", Type: bigquery.TimestampFieldType, Required: true},
	},
}
View Source
var EventsPush = bigquery.TableMetadata{
	Name: "events_push",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "created_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "login", Type: bigquery.StringFieldType, Required: true},
		{Name: "id", Type: bigquery.StringFieldType, Required: true},
		{Name: "type", Type: bigquery.StringFieldType, Required: true},
		{Name: "head_sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "message", Type: bigquery.StringFieldType, Required: true},
		{Name: "created_at", Type: bigquery.TimestampFieldType, Required: true},
	},
}
View Source
var Incidents = bigquery.TableMetadata{
	Name: "incidents",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "inserted_at",
	},
	Schema: bigquery.Schema{
		{Name: "id", Type: bigquery.StringFieldType, Required: true},
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "description", Type: bigquery.StringFieldType, Required: true},
		{Name: "sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "inserted_at", Type: bigquery.TimestampFieldType, Required: true},
		{Name: "resolved_at", Type: bigquery.TimestampFieldType, Required: true},
	},
}
View Source
var PullReqCommits = bigquery.TableMetadata{
	Name: "pullreqs_commits",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "created_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "login", Type: bigquery.StringFieldType, Required: true},
		{Name: "id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "number", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "message", Type: bigquery.StringFieldType, Required: true},
		{Name: "created_at", Type: bigquery.TimestampFieldType, Required: true},
	},
}
View Source
var PullReqs = bigquery.TableMetadata{
	Name: "pullreqs",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "created_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "login", Type: bigquery.StringFieldType, Required: true},
		{Name: "id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "number", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "title", Type: bigquery.StringFieldType, Required: true},
		{Name: "state", Type: bigquery.StringFieldType, Required: true},
		{Name: "merge_commit_sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "created_at", Type: bigquery.TimestampFieldType, Required: true},
		{Name: "updated_at", Type: bigquery.TimestampFieldType},
		{Name: "merged_at", Type: bigquery.TimestampFieldType},
		{Name: "closed_at", Type: bigquery.TimestampFieldType},
	},
}
View Source
var Releases = bigquery.TableMetadata{
	Name: "releases",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "tagged_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "login", Type: bigquery.StringFieldType, Required: true},
		{Name: "id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "name", Type: bigquery.StringFieldType, Required: true},
		{Name: "target_commitish", Type: bigquery.StringFieldType, Required: true},
		{Name: "tag_name", Type: bigquery.StringFieldType, Required: true},
		{Name: "tag_sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "tagged_at", Type: bigquery.TimestampFieldType, Required: true},
		{Name: "published_at", Type: bigquery.TimestampFieldType, Required: true},
	},
}
View Source
var ReleasesCommits = bigquery.TableMetadata{
	Name: "releases_commits",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "created_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "login", Type: bigquery.StringFieldType, Required: true},
		{Name: "release_id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "tag_name", Type: bigquery.StringFieldType, Required: true},
		{Name: "tag_sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "message", Type: bigquery.StringFieldType, Required: true},
		{Name: "created_at", Type: bigquery.TimestampFieldType, Required: true},
		{Name: "tagged_at", Type: bigquery.TimestampFieldType, Required: true},
		{Name: "published_at", Type: bigquery.TimestampFieldType, Required: true},
	},
}
View Source
var WorkflowJobs = bigquery.TableMetadata{
	Name: "workflow_jobs",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "started_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "workflow_id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "workflow_name", Type: bigquery.StringFieldType, Required: true},
		{Name: "run_id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "run_number", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "job_id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "job_name", Type: bigquery.StringFieldType, Required: true},
		{Name: "status", Type: bigquery.StringFieldType, Required: true},
		{Name: "conclusion", Type: bigquery.StringFieldType},
		{Name: "started_at", Type: bigquery.TimestampFieldType, Required: true},
		{Name: "completed_at", Type: bigquery.TimestampFieldType},
	},
}
View Source
var WorkflowRuns = bigquery.TableMetadata{
	Name: "workflow_runs",
	TimePartitioning: &bigquery.TimePartitioning{
		Type:  bigquery.MonthPartitioningType,
		Field: "created_at",
	},
	Schema: bigquery.Schema{
		{Name: "owner", Type: bigquery.StringFieldType, Required: true},
		{Name: "repository", Type: bigquery.StringFieldType, Required: true},
		{Name: "workflow_id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "workflow_name", Type: bigquery.StringFieldType, Required: true},
		{Name: "run_id", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "run_number", Type: bigquery.IntegerFieldType, Required: true},
		{Name: "head_sha", Type: bigquery.StringFieldType, Required: true},
		{Name: "status", Type: bigquery.StringFieldType, Required: true},
		{Name: "conclusion", Type: bigquery.StringFieldType},
		{Name: "created_at", Type: bigquery.TimestampFieldType, Required: true},
		{Name: "updated_at", Type: bigquery.TimestampFieldType},
	},
}

Functions

func Create

func Create(ctx context.Context, dsn string, meta []bigquery.TableMetadata) error

func Delete

func Delete(ctx context.Context, dsn string, tables []bigquery.TableMetadata) error

func DeleteAllView

func DeleteAllView(ctx context.Context, dsn string) error

func Insert

func Insert(ctx context.Context, dsn, table string, items []interface{}) error

func Name

func Name(owner, repository string) string

func Query

func Query(ctx context.Context, query string, fn func(values []bigquery.Value)) error

func Replace added in v0.0.5

func Replace(s string) string

Types

type Client

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

func New

func New(ctx context.Context) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Create

func (c *Client) Create(ctx context.Context, dsn string, meta []bigquery.TableMetadata) error

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, dsn string, tables []bigquery.TableMetadata) error

func (*Client) DeleteAllView

func (c *Client) DeleteAllView(ctx context.Context, dsn string) error

func (*Client) Insert

func (c *Client) Insert(ctx context.Context, dsn, table string, items []interface{}) error

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string, fn func(values []bigquery.Value)) error

type Commit

type Commit struct {
	Owner      string    `bigquery:"owner"`
	Repository string    `bigquery:"repository"`
	Login      string    `bigquery:"login"`
	SHA        string    `bigquery:"sha"`
	Message    string    `bigquery:"message"`
	CreatedAt  time.Time `bigquery:"created_at"`
}

type Event

type Event struct {
	Owner      string    `bigquery:"owner"`
	Repository string    `bigquery:"repository"`
	Login      string    `bigquery:"login"`
	ID         string    `bigquery:"id"`
	Type       string    `bigquery:"type"`
	RawPayload string    `bigquery:"raw_payload"`
	CreatedAt  time.Time `bigquery:"created_at"`
}

type Incident

type Incident struct {
	ID          string    `bigquery:"id" json:"id"`
	Owner       string    `bigquery:"owner" json:"owner"`
	Repository  string    `bigquery:"repository" json:"repository"`
	Description string    `bigquery:"description" json:"description"`
	SHA         string    `bigquery:"sha" json:"sha"`
	InsertedAt  time.Time `bigquery:"inserted_at" json:"inserted_at"`
	ResolvedAt  time.Time `bigquery:"resolved_at" json:"resolved_at"`
}

type PullReq

type PullReq struct {
	Owner          string    `bigquery:"owner"`
	Repository     string    `bigquery:"repository"`
	Login          string    `bigquery:"login"`
	ID             int64     `bigquery:"id"`
	Number         int64     `bigquery:"number"`
	Title          string    `bigquery:"title"`
	State          string    `bigquery:"state"`
	MergeCommitSHA string    `bigquery:"merge_commit_sha"`
	CreatedAt      time.Time `bigquery:"created_at"`
	UpdatedAt      time.Time `bigquery:"updated_at"`
	MergedAt       time.Time `bigquery:"merged_at"`
	ClosedAt       time.Time `bigquery:"closed_at"`
}

type PullReqCommit

type PullReqCommit struct {
	Owner      string    `bigquery:"owner"`
	Repository string    `bigquery:"repository"`
	Login      string    `bigquery:"login"`
	ID         int64     `bigquery:"id"`
	Number     int64     `bigquery:"number"`
	SHA        string    `bigquery:"sha"`
	Message    string    `bigquery:"message"`
	CreatedAt  time.Time `bigquery:"created_at"`
}

type PushEvent

type PushEvent struct {
	Owner      string    `bigquery:"owner"`
	Repository string    `bigquery:"repository"`
	Login      string    `bigquery:"login"`
	ID         string    `bigquery:"id"`
	Type       string    `bigquery:"type"`
	HeadSHA    string    `bigquery:"head_sha"`
	SHA        string    `bigquery:"sha"`
	Message    string    `bigquery:"message"`
	CreatedAt  time.Time `bigquery:"created_at"`
}

type QueryBuilder added in v0.0.5

type QueryBuilder struct {
}

func (*QueryBuilder) Build added in v0.0.5

func (b *QueryBuilder) Build() string

type Release

type Release struct {
	Owner           string    `bigquery:"owner"`
	Repository      string    `bigquery:"repository"`
	Login           string    `bigquery:"login"`
	ID              int64     `bigquery:"id"`
	TargetCommitish string    `bigquery:"target_commitish"`
	TagName         string    `bigquery:"tag_name"`
	TagSHA          string    `bigquery:"tag_sha"`
	Name            string    `bigquery:"name"`
	TaggedAt        time.Time `bigquery:"tagged_at"`
	PublishedAt     time.Time `bigquery:"published_at"`
}

type ReleasesCommit added in v0.0.5

type ReleasesCommit struct {
	Owner       string    `bigquery:"owner"`
	Repository  string    `bigquery:"repository"`
	Login       string    `bigquery:"login"`
	ReleaseID   int64     `bigquery:"release_id"`
	TagName     string    `bigquery:"tag_name"`
	TagSHA      string    `bigquery:"tag_sha"`
	SHA         string    `bigquery:"sha"`
	CreatedAt   time.Time `bigquery:"created_at"`
	TaggedAt    time.Time `bigquery:"tagged_at"`
	PublishedAt time.Time `bigquery:"published_at"`
	Message     string    `bigquery:"message"`
}

type WorkflowJob

type WorkflowJob struct {
	Owner        string    `bigquery:"owner"`
	Repository   string    `bigquery:"repository"`
	WorkflowID   int64     `bigquery:"workflow_id"`
	WorkflowName string    `bigquery:"workflow_name"`
	RunID        int64     `bigquery:"run_id"`
	RunNumber    int64     `bigquery:"run_number"`
	JobID        int64     `bigquery:"job_id"`
	JobName      string    `bigquery:"job_name"`
	Status       string    `bigquery:"status"`
	Conclusion   string    `bigquery:"conclusion"`
	StartedAt    time.Time `bigquery:"started_at"`
	CompletedAt  time.Time `bigquery:"completed_at"`
}

type WorkflowRun

type WorkflowRun struct {
	Owner        string    `bigquery:"owner"`
	Repository   string    `bigquery:"repository"`
	WorkflowID   int64     `bigquery:"workflow_id"`
	WorkflowName string    `bigquery:"workflow_name"`
	RunID        int64     `bigquery:"run_id"`
	RunNumber    int64     `bigquery:"run_number"`
	HeadSHA      string    `bigquery:"head_sha"`
	Status       string    `bigquery:"status"`
	Conclusion   string    `bigquery:"conclusion"`
	CreatedAt    time.Time `bigquery:"created_at"`
	UpdatedAt    time.Time `bigquery:"updated_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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