gcloud

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 22 Imported by: 1

README

Google Storage blobstore

Configuration

See https://cloud.google.com/docs/authentication/production to understand how is made the authentication against google cloud storage

Nowdays we support three different ways in order to let Cadence know where your google keyfile credentials are located

  • Cadence archival deployment.yaml configuration file
  • GOOGLE_APPLICATION_CREDENTIALS environment variable
  • Google default credentials location

If more than one credentials location is given, then Cadence will resolve the conflicts by the following priority:

GOOGLE_APPLICATION_CREDENTIALS > Cadencen archival deployment.yaml > Google default credentials

Be sure that you have created your bucket first, and have enought rights in order to read/write over your bucket.

Gcloud Archival example

Enabling archival is done by using the configuration below. credentialsPath is required but could be empty "" in order to allow a Google default credentials.

archival:
  history:
    status: "enabled"
    enableRead: true
    provider:
      gstorage:
        credentialsPath: "/tmp/keyfile.json"
  visibility:
    status: "enabled"
    enableRead: true
    provider:
      gstorage:
        credentialsPath: "/tmp/keyfile.json"

domainDefaults:
  archival:
    history:
      status: "enabled"
      URI: "gs://my-bucket-cad/cadence_archival/development"
    visibility:
      status: "enabled"
      URI: "gs://my-bucket-cad/cadence_archival/visibility"

Visibility query syntax

You can query the visibility store by using the cadence workflow listarchived command

The syntax for the query is based on SQL

Supported column names are

  • WorkflowType String
  • WorkflowID String
  • StartTime Date
  • CloseTime Date
  • SearchPrecision String - Day, Hour, Minute, Second

One of these fields are required, StartTime or CloseTime and they are mutually exclusive and also SearchPrecision.

Searching for a record will be done in times in the UTC timezone

SearchPrecision specifies what range you want to search for records. If you use SearchPrecision = 'Day' it will search all records starting from 2020-01-21T00:00:00Z to 2020-01-21T59:59:59Z

Limitations
  • The only operator supported is =
  • Currently It's not possible to guarantee the resulSet order, specially if the pageSize it's fullfilled.
Example

Searches the first 20 records for a given day 2020-01-21

./cadence --do samples-domain workflow listarchived -ps="20" -q "StartTime = '2020-01-21T00:00:00Z' AND SearchPrecision='Day'"

Archival query syntax

Once you have a workflowId and a runId you can retrieve your workflow history.

example:

./cadence --do samples-domain workflow show -w workflow-id -r runId

Documentation

Overview

Package gcloud is a generated GoMock package.

Index

Constants

View Source
const (
	WorkflowID      = "WorkflowID"
	RunID           = "RunID"
	WorkflowType    = "WorkflowType"
	CloseTime       = "CloseTime"
	StartTime       = "StartTime"
	CloseStatus     = "CloseStatus"
	SearchPrecision = "SearchPrecision"
)

All allowed fields for filtering

View Source
const (
	PrecisionDay    = "Day"
	PrecisionHour   = "Hour"
	PrecisionMinute = "Minute"
	PrecisionSecond = "Second"
)

Precision specific values

View Source
const (
	// URIScheme is the scheme for the gcloud storage implementation
	URIScheme = "gs"
)

Variables

This section is empty.

Functions

func NewHistoryArchiver

func NewHistoryArchiver(
	container *archiver.HistoryBootstrapContainer,
	config *config.GstorageArchiver,
) (archiver.HistoryArchiver, error)

NewHistoryArchiver creates a new gcloud storage HistoryArchiver

func NewVisibilityArchiver

NewVisibilityArchiver creates a new archiver.VisibilityArchiver based on filestore

Types

type MockQueryParser

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

MockQueryParser is a mock of QueryParser interface

func NewMockQueryParser

func NewMockQueryParser(ctrl *gomock.Controller) *MockQueryParser

NewMockQueryParser creates a new mock instance

func (*MockQueryParser) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockQueryParser) Parse

func (m *MockQueryParser) Parse(query string) (*parsedQuery, error)

Parse mocks base method

type MockQueryParserMockRecorder

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

MockQueryParserMockRecorder is the mock recorder for MockQueryParser

func (*MockQueryParserMockRecorder) Parse

func (mr *MockQueryParserMockRecorder) Parse(query interface{}) *gomock.Call

Parse indicates an expected call of Parse

type QueryParser

type QueryParser interface {
	Parse(query string) (*parsedQuery, error)
}

QueryParser parses a limited SQL where clause into a struct

func NewQueryParser

func NewQueryParser() QueryParser

NewQueryParser creates a new query parser for filestore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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