Documentation
¶
Index ¶
- Constants
- Variables
- func ExecuteTemplate(query string, v map[string]interface{}) (string, error)
- func ImportBigQueryHandleFunc(datasetID string) http.HandlerFunc
- func ReceiveCloudSQLExportOCNHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func ReceiveCloudSQLExportPubSubHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func ReceiveOCNHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func ReceivePubSubSampleHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func ReceiveStorageBQLoadOCNHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func SetCloudSQLAdminService(service CloudSQLAdminService)
- func SetStorageService(service StorageService)
- func SetTaskQueueService(service TaskQueueService)
- func SetupBatch(swPlugin *swagger.Plugin)
- func SetupBigQuery(swPlugin *swagger.Plugin)
- func SetupCronCloudSQLExportAPI(swPlugin *swagger.Plugin)
- func SetupCronDatastoreExportAPI(swPlugin *swagger.Plugin)
- func SetupCronQueryAPI(swPlugin *swagger.Plugin)
- func SetupScheduleAPI(swPlugin *swagger.Plugin)
- func SetupScheduleCloudSQLExportAPI(swPlugin *swagger.Plugin)
- func SetupScheduleDatastoreExportAPI(swPlugin *swagger.Plugin)
- func SetupStorageBQLoadConfigAPI(swPlugin *swagger.Plugin)
- func SetupTQBuildQueryAPI(swPlugin *swagger.Plugin)
- func SetupTQCloudSQLExportAPI(swPlugin *swagger.Plugin)
- func SetupTQCloudSQLExportAfterAPI(swPlugin *swagger.Plugin)
- func SetupTQDatastoreExportAPI(swPlugin *swagger.Plugin)
- type BatchAPI
- type BatchAPIPostRequest
- type BatchAPIPostResponse
- type BigQueryAPI
- type BigQueryAPIPostRequest
- type BigQueryAPIPostResponse
- type BigQueryLoadWithAutodetectParam
- type BigQueryService
- func (service *BigQueryService) BuildTableSchema(schema string) (*bigquery.TableSchema, error)
- func (service *BigQueryService) LoadFromCloudSQLExport(ctx context.Context, job *ScheduleCloudSQLExportJob) error
- func (service *BigQueryService) LoadWithAutodetect(ctx context.Context, param *BigQueryLoadWithAutodetectParam) error
- type CloudSQLAdminService
- type CloudSQLAdminServiceImpl
- type CloudSQLExportConfig
- type CloudSQLExportMutex
- type CloudSQLExportMutexStore
- func (store *CloudSQLExportMutexStore) Key(ctx context.Context, client datastore.Client, projectID string, ...) datastore.Key
- func (store *CloudSQLExportMutexStore) Kind() string
- func (store *CloudSQLExportMutexStore) Lock(ctx context.Context, projectID string, instance string, jobKey datastore.Key) error
- func (store *CloudSQLExportMutexStore) Unlock(ctx context.Context, projectID string, instance string, jobKey datastore.Key) error
- type CronCloudSQLExportAPI
- type CronDatastoreExportAPI
- type CronQueryAPI
- type DS2BQService
- type DS2BQServiceImple
- type DatastoreExportForm
- type GCSObjectToBQJobReq
- type Plugger
- type Plugin
- type Schedule
- type ScheduleAPI
- type ScheduleAPIPostRequest
- type ScheduleAPIPostResponse
- type ScheduleCloudSQLExport
- type ScheduleCloudSQLExportAPI
- type ScheduleCloudSQLExportAPIPostRequest
- type ScheduleCloudSQLExportAPIPostResponse
- type ScheduleCloudSQLExportJob
- type ScheduleCloudSQLExportJobStore
- func (store *ScheduleCloudSQLExportJobStore) Get(ctx context.Context, key datastore.Key) (*ScheduleCloudSQLExportJob, error)
- func (store *ScheduleCloudSQLExportJobStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
- func (store *ScheduleCloudSQLExportJobStore) Kind() string
- func (store *ScheduleCloudSQLExportJobStore) Put(ctx context.Context, job *ScheduleCloudSQLExportJob) (*ScheduleCloudSQLExportJob, error)
- type ScheduleCloudSQLExportQueryBuilder
- func (bldr *ScheduleCloudSQLExportQueryBuilder) Ancestor(parentKey datastore.Key) *ScheduleCloudSQLExportQueryBuilder
- func (bldr *ScheduleCloudSQLExportQueryBuilder) KeysOnly() *ScheduleCloudSQLExportQueryBuilder
- func (bldr *ScheduleCloudSQLExportQueryBuilder) Limit(limit int) *ScheduleCloudSQLExportQueryBuilder
- func (bldr *ScheduleCloudSQLExportQueryBuilder) Offset(offset int) *ScheduleCloudSQLExportQueryBuilder
- func (bldr *ScheduleCloudSQLExportQueryBuilder) Query() datastore.Query
- func (bldr *ScheduleCloudSQLExportQueryBuilder) Start(cur datastore.Cursor) *ScheduleCloudSQLExportQueryBuilder
- type ScheduleCloudSQLExportQueryProperty
- func (p *ScheduleCloudSQLExportQueryProperty) Asc() *ScheduleCloudSQLExportQueryBuilder
- func (p *ScheduleCloudSQLExportQueryProperty) Desc() *ScheduleCloudSQLExportQueryBuilder
- func (p *ScheduleCloudSQLExportQueryProperty) Equal(value interface{}) *ScheduleCloudSQLExportQueryBuilder
- func (p *ScheduleCloudSQLExportQueryProperty) Filter(op string, value interface{}) *ScheduleCloudSQLExportQueryBuilder
- func (p *ScheduleCloudSQLExportQueryProperty) GreaterThan(value interface{}) *ScheduleCloudSQLExportQueryBuilder
- func (p *ScheduleCloudSQLExportQueryProperty) GreaterThanOrEqual(value interface{}) *ScheduleCloudSQLExportQueryBuilder
- func (p *ScheduleCloudSQLExportQueryProperty) LessThan(value interface{}) *ScheduleCloudSQLExportQueryBuilder
- func (p *ScheduleCloudSQLExportQueryProperty) LessThanOrEqual(value interface{}) *ScheduleCloudSQLExportQueryBuilder
- type ScheduleCloudSQLExportStore
- func (store *ScheduleCloudSQLExportStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
- func (store *ScheduleCloudSQLExportStore) Kind() string
- func (store *ScheduleCloudSQLExportStore) ListAll(ctx context.Context) ([]*ScheduleCloudSQLExport, error)
- func (store *ScheduleCloudSQLExportStore) NewKey(ctx context.Context, client datastore.Client) datastore.Key
- func (store *ScheduleCloudSQLExportStore) Put(ctx context.Context, key datastore.Key, schedule *ScheduleCloudSQLExport) (*ScheduleCloudSQLExport, error)
- type ScheduleDatastoreExport
- type ScheduleDatastoreExportAPI
- type ScheduleDatastoreExportAPIPostRequest
- type ScheduleDatastoreExportAPIPostResponse
- type ScheduleDatastoreExportStore
- func (store *ScheduleDatastoreExportStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
- func (store *ScheduleDatastoreExportStore) Kind() string
- func (store *ScheduleDatastoreExportStore) ListAll(ctx context.Context) ([]*ScheduleDatastoreExport, error)
- func (store *ScheduleDatastoreExportStore) NewKey(ctx context.Context, client datastore.Client) datastore.Key
- func (store *ScheduleDatastoreExportStore) Put(ctx context.Context, key datastore.Key, schedule *ScheduleDatastoreExport) (*ScheduleDatastoreExport, error)
- func (store *ScheduleDatastoreExportStore) QueryByBucket(ctx context.Context, bucket string) ([]*ScheduleDatastoreExport, error)
- type ScheduleStore
- func (store *ScheduleStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
- func (store *ScheduleStore) Kind() string
- func (store *ScheduleStore) ListAll(ctx context.Context) ([]*Schedule, error)
- func (store *ScheduleStore) NewKey(ctx context.Context, client datastore.Client) datastore.Key
- func (store *ScheduleStore) Put(ctx context.Context, key datastore.Key, schedule *Schedule) (*Schedule, error)
- type StorageBQLoadConfig
- type StorageBQLoadConfigAPI
- type StorageBQLoadConfigAPIPostRequest
- type StorageBQLoadConfigAPIPostResponse
- type StorageBQLoadConfigStore
- func (store *StorageBQLoadConfigStore) Get(ctx context.Context, key datastore.Key) (*StorageBQLoadConfig, error)
- func (store *StorageBQLoadConfigStore) Key(ctx context.Context, client datastore.Client, bucket string) datastore.Key
- func (store *StorageBQLoadConfigStore) Kind() string
- func (store *StorageBQLoadConfigStore) Put(ctx context.Context, key datastore.Key, config *StorageBQLoadConfig) (*StorageBQLoadConfig, error)
- type StorageService
- type StorageServiceImpl
- type TQBuildQueryAPI
- type TQBuildQueryAPIPostRequest
- type TQBuildQueryAPIPostResponse
- type TQCloudSQLExportAPI
- type TQCloudSQLExportAPIAfterPostRequest
- type TQCloudSQLExportAPIPostRequest
- type TQCloudSQLExportAfterAPI
- type TQDatastoreExportAPI
- type TQDatastoreExportAPIPostRequest
- type TaskQueueService
- type TaskQueueServiceImpl
Constants ¶
const TQCloudSQLExportAPIPath = "/tq/cloudsql/export"
TQCloudSQLExportAPIPath is Cloud SQL ExportのTaskQueue用のPath
const TQCloudSQLExportAfterAPIPath = "/tq/cloudsql/export/after"
TQCloudSQLExportAfterAPIPath is Cloud SQL Export後にOPがどうなったかを確認するTaskQueueのPath
const TQDatastoreExportAPIPath = "/tq/datastore/export"
TQDatastoreExportAPIPath is TQDatastoreExportAPI Path
Variables ¶
var ErrCloudSQLExportMutexCollision = errors.New("collision cloud sql export mutex")
ErrCloudSQLExportMutexCollision is すでに誰かが掴んでいる時に返すエラー
Functions ¶
func ExecuteTemplate ¶
ExecuteTemplate is text template execute
func ImportBigQueryHandleFunc ¶
func ImportBigQueryHandleFunc(datasetID string) http.HandlerFunc
ImportBigQueryHandleFunc returns a http.HandlerFunc that imports GCSObject to BigQuery.
func ReceiveCloudSQLExportOCNHandler ¶
ReceiveCloudSQLExportOCNHandler is Cloud SQL ExportのファイルがCloud Storageに入った時にOCNを受け取り、BigQueryにUploadするためのHandler
func ReceiveCloudSQLExportPubSubHandler ¶
func ReceiveCloudSQLExportPubSubHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
ReceiveCloudSQLExportPubSubHandler is Cloud SQL ExportのファイルCloud Storageに入った時のCloud Pus/SubのPushを受け取って解釈するHandler
func ReceiveOCNHandler ¶
ReceiveOCNHandler is Datastore ExportのファイルがCloud Storageに入った時にBigQueryにUploadするためのOCNのHandler
func ReceivePubSubSampleHandler ¶
ReceivePubSubSampleHandler is Cloud Pus/SubのPushを受け取って解釈するHandler
func ReceiveStorageBQLoadOCNHandler ¶
ReceiveStorageBQLoadOCNHandler is Cloud Storage load to BigQueryのOCNを受け取るためのHandler
func SetCloudSQLAdminService ¶
func SetCloudSQLAdminService(service CloudSQLAdminService)
SetCloudSQLAdminService is Replace Imple Use it to replace with Mock with Unit Test.
func SetStorageService ¶
func SetStorageService(service StorageService)
SetStorageService is Replace Imple Use it to replace with Mock with Unit Test.
func SetTaskQueueService ¶
func SetTaskQueueService(service TaskQueueService)
SetTaskQueueService is Replace Imple Use it to replace with Mock with Unit Test.
func SetupBatch ¶
func SetupBigQuery ¶
func SetupCronQueryAPI ¶
func SetupScheduleAPI ¶
func SetupTQBuildQueryAPI ¶
Types ¶
type BatchAPI ¶
type BatchAPI struct{}
BatchAPI is Batch API
func (*BatchAPI) Post ¶
func (api *BatchAPI) Post(ctx context.Context, form *BatchAPIPostRequest) (*BatchAPIPostResponse, error)
Post is Batch API Post Handler
type BatchAPIPostRequest ¶
type BatchAPIPostRequest struct { ProjectID string `json:"projectID"` DstProjectID string `json:"dstProjectID"` DstDatasetID string `json:"dstDatasetID"` DstTableID string `json:"dstTableID"` QueryPathBucket string `json:"queryPathBucket"` QueryPathObject string `json:"queryPathObject"` CreateDisposition string `json:"createDisposition"` StartDate string `json:"startDate"` CountDate int `json:"countDate"` }
BatchAPIPostRequest is Batch API Post form
type BatchAPIPostResponse ¶
type BatchAPIPostResponse struct { }
BatchAPIPostResponse is Batch API Post response
type BigQueryAPI ¶
type BigQueryAPI struct{}
BigQueryAPI is BigQuery API
func (*BigQueryAPI) Post ¶
func (api *BigQueryAPI) Post(ctx context.Context, form *BigQueryAPIPostRequest) (*BigQueryAPIPostResponse, error)
Post is BigQuery API Post Handler
type BigQueryAPIPostRequest ¶
type BigQueryAPIPostRequest struct { ProjectID string `json:"projectID"` DstProjectID string `json:"dstProjectID"` DstDatasetID string `json:"dstDatasetID"` DstTableID string `json:"dstTableID"` Query string `json:"query"` QueryPathBucket string `json:"queryPathBucket"` QueryPathObject string `json:"queryPathObject"` CreateDisposition string `json:"createDisposition"` }
BigQueryAPIPostRequest is BigQuery API Post form
type BigQueryAPIPostResponse ¶
type BigQueryAPIPostResponse struct {
JobID string `json:"jobID"`
}
BigQueryAPIPostResponse is BigQuery API Post response
type BigQueryLoadWithAutodetectParam ¶
type BigQueryLoadWithAutodetectParam struct { CloudStorageURI string BigQueryProjectID string BigQueryDataset string BigQueryTable string SourceFormat string }
BigQueryLoadWithAutodetectParam is LoadWithAutodetect Param
type BigQueryService ¶
type BigQueryService struct{}
BigQueryService is BigQuery APIのためのService
func (*BigQueryService) BuildTableSchema ¶
func (service *BigQueryService) BuildTableSchema(schema string) (*bigquery.TableSchema, error)
BuildTableSchema is TableSchema文字列からbigquery.TableSchemaを生成する TableSchema文字列 Example Name:STRING,Age:INTEGER
func (*BigQueryService) LoadFromCloudSQLExport ¶
func (service *BigQueryService) LoadFromCloudSQLExport(ctx context.Context, job *ScheduleCloudSQLExportJob) error
LoadFromCloudSQLExport is Cloud SQL Export CSVをBigQueryにLoadする
func (*BigQueryService) LoadWithAutodetect ¶
func (service *BigQueryService) LoadWithAutodetect(ctx context.Context, param *BigQueryLoadWithAutodetectParam) error
LoadWithAutodetect is BigQuery.LoadをAutodetectで実行する
type CloudSQLAdminService ¶
type CloudSQLAdminService interface { Export(ctx context.Context, config *CloudSQLExportConfig) (*sqladmin.Operation, error) GetOp(ctx context.Context, projectID string, operation string) (*sqladmin.Operation, error) }
CloudSQLAdminService is Cloud SQLのAdmin APIに関するService
func NewCloudSQLAdminService ¶
func NewCloudSQLAdminService() CloudSQLAdminService
NewCloudSQLAdminService is CloudSQLAdminServiceを作成
type CloudSQLAdminServiceImpl ¶
type CloudSQLAdminServiceImpl struct{}
CloudSQLAdminServiceImpl is Cloud SQL Adminの実装をぶらさげるstruct
func (*CloudSQLAdminServiceImpl) Export ¶
func (service *CloudSQLAdminServiceImpl) Export(ctx context.Context, config *CloudSQLExportConfig) (*sqladmin.Operation, error)
Export is Cloud SQLにSQLを実行して、Cloud StorageにExportする
type CloudSQLExportConfig ¶
type CloudSQLExportConfig struct { ProjectID string Instance string Databases []string SQL string ExportURI string }
CloudSQLExportConfig is Cloud SQL Export API実行に必要なパラメータ
type CloudSQLExportMutex ¶
type CloudSQLExportMutex struct { Key datastore.Key `datastore:"-"` // Cloud SQL Instance ID ScheduleCloudSQLExportJobKey datastore.Key // Mutexを掴んでいるJobのKey CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` SchemaVersion int `json:"-"` }
CloudSQLExportMutex is Cloud SQL ExportがInstanceごとに1つしか同時実行できないので、実行を管理するためのKind
type CloudSQLExportMutexStore ¶
type CloudSQLExportMutexStore struct{}
CloudSQLExportMutexStore is CloudSQLExportMutex Function
func (*CloudSQLExportMutexStore) Key ¶
func (store *CloudSQLExportMutexStore) Key(ctx context.Context, client datastore.Client, projectID string, instance string) datastore.Key
Key is Create CloudSQLExportMutex Key
func (*CloudSQLExportMutexStore) Kind ¶
func (store *CloudSQLExportMutexStore) Kind() string
Kind is Get CloudSQLExportMutex Kind Name
func (*CloudSQLExportMutexStore) Lock ¶
func (store *CloudSQLExportMutexStore) Lock(ctx context.Context, projectID string, instance string, jobKey datastore.Key) error
Lock is Make the state that grabbed the specified mutex. If already grabbed, ErrCloudSQLExportMutexCollision is returned. 指定したMutexを掴んだ状態にする。すでに掴まれていた場合は、ErrCloudSQLExportMutexCollision が返ってくる。
type CronCloudSQLExportAPI ¶
type CronCloudSQLExportAPI struct{}
CronCloudSQLExportAPI is Cron Cloud SQL Export API
type CronDatastoreExportAPI ¶
type CronDatastoreExportAPI struct{}
CronDatastoreExportAPI is Cron Datastore Export API
type DS2BQService ¶
type DS2BQService interface {
Export(ctx context.Context, form *DatastoreExportForm) error
}
DS2BQService is Datastore to BigQuery Service
type DS2BQServiceImple ¶
type DS2BQServiceImple struct{}
DS2BQServiceImple is Default DS2BQService
func (*DS2BQServiceImple) Export ¶
func (s *DS2BQServiceImple) Export(ctx context.Context, form *DatastoreExportForm) error
Export is Datastore Export to Cloud Storage Job Insert
type DatastoreExportForm ¶
DatastoreExportForm is Export Request Param
type GCSObjectToBQJobReq ¶
type GCSObjectToBQJobReq struct { Bucket string `json:"bucket"` FilePath string `json:"filePath"` KindName string `json:"kindName"` TimeCreated time.Time `json:"TimeCreated"` }
GCSObjectToBQJobReq means request of OCN to BQ.
func DecodeGCSObjectToBQJobReq ¶
func DecodeGCSObjectToBQJobReq(r io.Reader) (*GCSObjectToBQJobReq, error)
DecodeGCSObjectToBQJobReq decodes a GCSObjectToBQJobReq from r.
type Plugin ¶
type Plugin interface { Init(typeName string) Ancestor(ancestor datastore.Key) KeysOnly() Start(cur datastore.Cursor) Offset(offset int) Limit(limit int) Filter(name, op string, value interface{}) Asc(name string) Desc(name string) }
Plugin supply hook point for query constructions.
type Schedule ¶
type Schedule struct { Key datastore.Key `json:"-" datastore:"-"` // TODO API Response用のKeyを入れる ProjectID string `json:"projectID"` DstProjectID string `json:"dstProjectID"` DstDatasetID string `json:"dstDatasetID"` DstTableID string `json:"dstTableID"` QueryPathBucket string `json:"queryPathBucket"` QueryPathObject string `json:"queryPathObject"` ScheduleV1 string `json:"scheduleV1"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` SchemaVersion int `json:"-"` }
Schedule is Schedule Model
type ScheduleAPI ¶
type ScheduleAPI struct{}
ScheduleAPI is Schedule API
func (*ScheduleAPI) Post ¶
func (api *ScheduleAPI) Post(ctx context.Context, form *ScheduleAPIPostRequest) (*ScheduleAPIPostResponse, error)
Post is Schedule API Post Handler
type ScheduleAPIPostRequest ¶
type ScheduleAPIPostRequest struct { ProjectID string `json:"projectID"` DstProjectID string `json:"dstProjectID"` DstDatasetID string `json:"dstDatasetID"` DstTableID string `json:"dstTableID"` QueryPathBucket string `json:"queryPathBucket"` QueryPathObject string `json:"queryPathObject"` CreateDisposition string `json:"createDisposition"` ScheduleV1 string `json:"scheduleV1"` ScheduleTimezone string `json:"scheduleTimezone"` }
ScheduleAPIPostRequest is Schedule API Post form
type ScheduleAPIPostResponse ¶
type ScheduleAPIPostResponse struct {
*Schedule
}
ScheduleAPIPostResponse is Schedule API Post response
type ScheduleCloudSQLExport ¶
type ScheduleCloudSQLExport struct { Key datastore.Key `json:"-" datastore:"-"` ProjectID string `json:"projectID"` // ExportするCloudSQLが存在するProjectID Instance string `json:"instance"` // ExportするCloudSQLのInstanceID Databases []string `json:"databases"` // ExportするCloudSQLのDatabase SQLBucket string `json:"sqlBucket"` // Export時に利用するSQLを置いているGCS Bucket. hoge SQLObject string `json:"sqlObject"` // Export時に利用するSQLを置いているGCS Object. export.sql ExportURI string `json:"exportURI"` // Export先のGCS Path. %sを入れるとyyyyMMddhhmmに置き換える gs://hoge/%s/fuga.csv BigQueryProjectID string `json:"bigQueryProjectID"` // Load先のBigQuery ProjectID BigQueryDataset string `json:"bigQueryDataset"` // Load先のBigQuery Dataset BigQueryTable string `json:"bigQueryTable"` // Load先のBigQuery Table BigQueryTableSchema string `json:"bigQueryTableSchema"` // LoadするのBigQueryTableのSchema文字列 Ex. Name:STRING,Age:INTEGER CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` SchemaVersion int `json:"-"` }
ScheduleCloudSQLExport is Cloud SQLをExportするScheduleの設定 +qgb
type ScheduleCloudSQLExportAPI ¶
type ScheduleCloudSQLExportAPI struct{}
ScheduleCloudSQLExportAPI is CloudSQLのExport ConfigのScheduleのためのAPI
func (*ScheduleCloudSQLExportAPI) Post ¶
func (api *ScheduleCloudSQLExportAPI) Post(ctx context.Context, form *ScheduleCloudSQLExportAPIPostRequest) (*ScheduleCloudSQLExportAPIPostResponse, error)
Post is ScheduleCloudSQLExportAPI Post Handler ScheduleCloudSQLExportを新規にDatastoreにPutする
type ScheduleCloudSQLExportAPIPostRequest ¶
type ScheduleCloudSQLExportAPIPostRequest struct { ProjectID string `json:"projectID"` // ExportするCloudSQLが存在するProjectID Instance string `json:"instance"` // ExportするCloudSQLのInstanceID Databases []string `json:"databases"` // ExportするCloudSQLのDatabase SQLBucket string `json:"sqlBucket"` // Export時に利用するSQLを置いているGCS Bucket. hoge SQLObject string `json:"sqlObject"` // Export時に利用するSQLを置いているGCS Object. export.sql ExportURI string `json:"exportURI"` // Export先のGCS Path. %sを入れるとyyyyMMddhhmmに置き換える gs://hoge/%s/fuga.csv BigQueryProjectID string `json:"bigQueryProjectID"` // Load先のBigQuery ProjectID BigQueryDataset string `json:"bigQueryDataset"` // Load先のBigQuery Dataset BigQueryTable string `json:"bigQueryTable"` // Load先のBigQuery Table BigQueryTableSchema string `json:"bigQueryTableSchema"` // LoadするのBigQueryTableのSchema文字列 Ex. Name:STRING,Age:INTEGER }
ScheduleCloudSQLExportAPIPostRequest is Post Param
type ScheduleCloudSQLExportAPIPostResponse ¶
type ScheduleCloudSQLExportAPIPostResponse struct {
*ScheduleCloudSQLExport
}
ScheduleCloudSQLExportAPIPostResponse is Post Response
type ScheduleCloudSQLExportJob ¶
type ScheduleCloudSQLExportJob struct { Key datastore.Key `json:"-" datastore:"-"` // ExportURIをKey Nameとして利用する ProjectID string `json:"projectID"` // ExportするCloudSQLが存在するProjectID Instance string `json:"instance"` // ExportするCloudSQLのInstanceID Databases []string `json:"databases"` // ExportするCloudSQLのDatabase SQLBucket string `json:"sqlBucket"` // Export時に利用するSQLを置いているGCS Bucket. hoge SQLObject string `json:"sqlObject"` // Export時に利用するSQLを置いているGCS Object. export.sql ExportURI string `json:"exportURI"` // Export先のGCS Path gs://hoge/yyyyMMddhhmm/fuga.csv BigQueryProjectID string `json:"bigQueryProjectID"` // Load先のBigQuery ProjectID BigQueryDataset string `json:"bigQueryDataset"` // Load先のBigQuery Dataset BigQueryTable string `json:"bigQueryTable"` // Load先のBigQuery Table BigQueryTableSchema string `json:"bigQueryTableSchema"` // LoadするのBigQueryTableのSchema文字列 Ex. Name:STRING,Age:INTEGER CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` SchemaVersion int `json:"-"` }
ScheduleCloudSQLExportJob is Cloud SQL Exportを実行した時のJob Cloud SQL Exportを実行する度に1件生成される
type ScheduleCloudSQLExportJobStore ¶
type ScheduleCloudSQLExportJobStore struct{}
ScheduleCloudSQLExportJobStore is Schedule Cloud SQL Export Job Function
func (*ScheduleCloudSQLExportJobStore) Get ¶
func (store *ScheduleCloudSQLExportJobStore) Get(ctx context.Context, key datastore.Key) (*ScheduleCloudSQLExportJob, error)
Get is ScheduleCloudSQLExportJob をDatastoreからGetする
func (*ScheduleCloudSQLExportJobStore) Key ¶
func (store *ScheduleCloudSQLExportJobStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
Key is Create ScheduleCloudSQLExportJob Key idにはExportURIを指定する
func (*ScheduleCloudSQLExportJobStore) Kind ¶
func (store *ScheduleCloudSQLExportJobStore) Kind() string
Kind is Get ScheduleCloudSQLExportJob Kind Name
func (*ScheduleCloudSQLExportJobStore) Put ¶
func (store *ScheduleCloudSQLExportJobStore) Put(ctx context.Context, job *ScheduleCloudSQLExportJob) (*ScheduleCloudSQLExportJob, error)
Put is ScheduleCloudSQLExportJob をDatastoreにPutする
type ScheduleCloudSQLExportQueryBuilder ¶
type ScheduleCloudSQLExportQueryBuilder struct { ProjectID *ScheduleCloudSQLExportQueryProperty Databases *ScheduleCloudSQLExportQueryProperty SQLBucket *ScheduleCloudSQLExportQueryProperty SQLObject *ScheduleCloudSQLExportQueryProperty ExportURI *ScheduleCloudSQLExportQueryProperty CreatedAt *ScheduleCloudSQLExportQueryProperty UpdatedAt *ScheduleCloudSQLExportQueryProperty SchemaVersion *ScheduleCloudSQLExportQueryProperty // contains filtered or unexported fields }
ScheduleCloudSQLExportQueryBuilder build query for ScheduleCloudSQLExport.
func NewScheduleCloudSQLExportQueryBuilder ¶
func NewScheduleCloudSQLExportQueryBuilder(client datastore.Client) *ScheduleCloudSQLExportQueryBuilder
NewScheduleCloudSQLExportQueryBuilder create new ScheduleCloudSQLExportQueryBuilder.
func NewScheduleCloudSQLExportQueryBuilderWithKind ¶
func NewScheduleCloudSQLExportQueryBuilderWithKind(client datastore.Client, kind string) *ScheduleCloudSQLExportQueryBuilder
NewScheduleCloudSQLExportQueryBuilderWithKind create new ScheduleCloudSQLExportQueryBuilder with specific kind.
func (*ScheduleCloudSQLExportQueryBuilder) Ancestor ¶
func (bldr *ScheduleCloudSQLExportQueryBuilder) Ancestor(parentKey datastore.Key) *ScheduleCloudSQLExportQueryBuilder
Ancestor sets parent key to ancestor query.
func (*ScheduleCloudSQLExportQueryBuilder) KeysOnly ¶
func (bldr *ScheduleCloudSQLExportQueryBuilder) KeysOnly() *ScheduleCloudSQLExportQueryBuilder
KeysOnly sets keys only option to query.
func (*ScheduleCloudSQLExportQueryBuilder) Limit ¶
func (bldr *ScheduleCloudSQLExportQueryBuilder) Limit(limit int) *ScheduleCloudSQLExportQueryBuilder
Limit setup to query.
func (*ScheduleCloudSQLExportQueryBuilder) Offset ¶
func (bldr *ScheduleCloudSQLExportQueryBuilder) Offset(offset int) *ScheduleCloudSQLExportQueryBuilder
Offset setup to query.
func (*ScheduleCloudSQLExportQueryBuilder) Query ¶
func (bldr *ScheduleCloudSQLExportQueryBuilder) Query() datastore.Query
Query returns *datastore.Query.
func (*ScheduleCloudSQLExportQueryBuilder) Start ¶
func (bldr *ScheduleCloudSQLExportQueryBuilder) Start(cur datastore.Cursor) *ScheduleCloudSQLExportQueryBuilder
Start setup to query.
type ScheduleCloudSQLExportQueryProperty ¶
type ScheduleCloudSQLExportQueryProperty struct {
// contains filtered or unexported fields
}
ScheduleCloudSQLExportQueryProperty has property information for ScheduleCloudSQLExportQueryBuilder.
func (*ScheduleCloudSQLExportQueryProperty) Asc ¶
func (p *ScheduleCloudSQLExportQueryProperty) Asc() *ScheduleCloudSQLExportQueryBuilder
Asc order.
func (*ScheduleCloudSQLExportQueryProperty) Desc ¶
func (p *ScheduleCloudSQLExportQueryProperty) Desc() *ScheduleCloudSQLExportQueryBuilder
Desc order.
func (*ScheduleCloudSQLExportQueryProperty) Equal ¶
func (p *ScheduleCloudSQLExportQueryProperty) Equal(value interface{}) *ScheduleCloudSQLExportQueryBuilder
Equal filter with value.
func (*ScheduleCloudSQLExportQueryProperty) Filter ¶
func (p *ScheduleCloudSQLExportQueryProperty) Filter(op string, value interface{}) *ScheduleCloudSQLExportQueryBuilder
Filter with op & value.
func (*ScheduleCloudSQLExportQueryProperty) GreaterThan ¶
func (p *ScheduleCloudSQLExportQueryProperty) GreaterThan(value interface{}) *ScheduleCloudSQLExportQueryBuilder
GreaterThan filter with value.
func (*ScheduleCloudSQLExportQueryProperty) GreaterThanOrEqual ¶
func (p *ScheduleCloudSQLExportQueryProperty) GreaterThanOrEqual(value interface{}) *ScheduleCloudSQLExportQueryBuilder
GreaterThanOrEqual filter with value.
func (*ScheduleCloudSQLExportQueryProperty) LessThan ¶
func (p *ScheduleCloudSQLExportQueryProperty) LessThan(value interface{}) *ScheduleCloudSQLExportQueryBuilder
LessThan filter with value.
func (*ScheduleCloudSQLExportQueryProperty) LessThanOrEqual ¶
func (p *ScheduleCloudSQLExportQueryProperty) LessThanOrEqual(value interface{}) *ScheduleCloudSQLExportQueryBuilder
LessThanOrEqual filter with value.
type ScheduleCloudSQLExportStore ¶
type ScheduleCloudSQLExportStore struct{}
ScheduleCloudSQLExportStore is Schedule Cloud SQL Export Function
func (*ScheduleCloudSQLExportStore) Key ¶
func (store *ScheduleCloudSQLExportStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
Key is Create ScheduleCloudSQLExport Key
func (*ScheduleCloudSQLExportStore) Kind ¶
func (store *ScheduleCloudSQLExportStore) Kind() string
Kind is Get ScheduleCloudSQLExport Kind Name
func (*ScheduleCloudSQLExportStore) ListAll ¶
func (store *ScheduleCloudSQLExportStore) ListAll(ctx context.Context) ([]*ScheduleCloudSQLExport, error)
ListAll is ScheduleCloudSQLExportStore を全件取得する
func (*ScheduleCloudSQLExportStore) NewKey ¶
func (store *ScheduleCloudSQLExportStore) NewKey(ctx context.Context, client datastore.Client) datastore.Key
NewKey is Create ScheduleCloudSQLExport Model Key
func (*ScheduleCloudSQLExportStore) Put ¶
func (store *ScheduleCloudSQLExportStore) Put(ctx context.Context, key datastore.Key, schedule *ScheduleCloudSQLExport) (*ScheduleCloudSQLExport, error)
Put is ScheduleCloudSQLExportをDatastoreにPutする
type ScheduleDatastoreExport ¶
type ScheduleDatastoreExport struct { Key datastore.Key `json:"-" datastore:"-"` ProjectID string `json:"projectID"` Kinds []string `json:"kinds"` Bucket string `json:"bucket"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` SchemaVersion int `json:"-"` }
ScheduleDatastoreExport is ScheduleDatastoreExport Model
type ScheduleDatastoreExportAPI ¶
type ScheduleDatastoreExportAPI struct{}
ScheduleDatastoreExportAPI is Datastore ExportのScheduleのためのAPI
func (*ScheduleDatastoreExportAPI) Post ¶
func (api *ScheduleDatastoreExportAPI) Post(ctx context.Context, form *ScheduleDatastoreExportAPIPostRequest) (*ScheduleDatastoreExportAPIPostResponse, error)
Post is ScheduleDatastoreExportAPI API Post Handler
type ScheduleDatastoreExportAPIPostRequest ¶
type ScheduleDatastoreExportAPIPostRequest struct { ProjectID string `json:"projectID"` Kinds []string `json:"kinds"` Bucket string `json:"bucket"` }
ScheduleDatastoreExportAPIPostRequest is ScheduleDatastoreExport API Post form
type ScheduleDatastoreExportAPIPostResponse ¶
type ScheduleDatastoreExportAPIPostResponse struct {
*ScheduleDatastoreExport
}
ScheduleDatastoreExportAPIPostResponse is ScheduleDatastoreExport API Post response
type ScheduleDatastoreExportStore ¶
type ScheduleDatastoreExportStore struct{}
ScheduleDatastoreExportStore is Schedule Datastore Function
func (*ScheduleDatastoreExportStore) Key ¶
func (store *ScheduleDatastoreExportStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
Key is Create Schedule Model Key
func (*ScheduleDatastoreExportStore) Kind ¶
func (store *ScheduleDatastoreExportStore) Kind() string
Kind is Get Schedule Kind Name
func (*ScheduleDatastoreExportStore) ListAll ¶
func (store *ScheduleDatastoreExportStore) ListAll(ctx context.Context) ([]*ScheduleDatastoreExport, error)
ListAll is Get All Schedule
func (*ScheduleDatastoreExportStore) NewKey ¶
func (store *ScheduleDatastoreExportStore) NewKey(ctx context.Context, client datastore.Client) datastore.Key
NewKey is Create Schedule Model Key for New Entity
func (*ScheduleDatastoreExportStore) Put ¶
func (store *ScheduleDatastoreExportStore) Put(ctx context.Context, key datastore.Key, schedule *ScheduleDatastoreExport) (*ScheduleDatastoreExport, error)
Put is Schedule put to Datastore
func (*ScheduleDatastoreExportStore) QueryByBucket ¶
func (store *ScheduleDatastoreExportStore) QueryByBucket(ctx context.Context, bucket string) ([]*ScheduleDatastoreExport, error)
QueryByBucket is Bucketが一致するEntity Listを取得する
type ScheduleStore ¶
type ScheduleStore struct{}
ScheduleStore is Schedule Datastore Function
func (*ScheduleStore) Key ¶
func (store *ScheduleStore) Key(ctx context.Context, client datastore.Client, id string) datastore.Key
Key is Create Schedule Model Key
func (*ScheduleStore) Kind ¶
func (store *ScheduleStore) Kind() string
Kind is Get Schedule Kind Name
func (*ScheduleStore) ListAll ¶
func (store *ScheduleStore) ListAll(ctx context.Context) ([]*Schedule, error)
ListAll is Get All Schedule
type StorageBQLoadConfig ¶
type StorageBQLoadConfig struct { Key datastore.Key `json:"-" datastore:"-"` FrmStorageBucket string `json:"frmStorageBucket"` // LoadするFileがあるCloud Storage Bucket DstBigQueryProjectID string `json:"dstBigQueryProjectID"` // Load先のBigQueryのProjectID DstBigQueryDataset string `json:"dstBigQueryDataset"` // Load先のBigQueryのDataset CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` SchemaVersion int `json:"-"` }
StorageBQLoadConfig is Cloud Storage上に置かれたFileをBigQueryにLoadするための設定 File名と同じTable名 かつ スキーマはAutoDetectで設定するのを前提にしているので、設定項目は最小限
type StorageBQLoadConfigAPI ¶
type StorageBQLoadConfigAPI struct{}
StorageBQLoadConfigAPI is Cloud StorageにUploadされたファイルをBigQueryにLoadするConfigに関するAPI
func (*StorageBQLoadConfigAPI) Post ¶
func (api *StorageBQLoadConfigAPI) Post(ctx context.Context, form *StorageBQLoadConfigAPIPostRequest) (*StorageBQLoadConfigAPIPostResponse, error)
Post is Payloadの情報を元に StorageBQLoadConfig を新規でDatastoreに登録するAPI Handler
type StorageBQLoadConfigAPIPostRequest ¶
type StorageBQLoadConfigAPIPostRequest struct { FrmStorageBucket string `json:"frmStorageBucket"` DstBigQueryProjectID string `json:"dstBigQueryProjectID"` DstBigQueryDataset string `json:"dstBigQueryDataset"` }
StorageBQLoadConfigAPIPostRequest is StorageBQLoadConfigAPI Post form
type StorageBQLoadConfigAPIPostResponse ¶
type StorageBQLoadConfigAPIPostResponse struct {
*StorageBQLoadConfig
}
StorageBQLoadConfigAPIPostResponse is StorageBQLoadConfigAPI Post response
type StorageBQLoadConfigStore ¶
type StorageBQLoadConfigStore struct{}
StorageBQLoadConfigStore is StorageBQLoadConfig Functions
func (*StorageBQLoadConfigStore) Get ¶
func (store *StorageBQLoadConfigStore) Get(ctx context.Context, key datastore.Key) (*StorageBQLoadConfig, error)
Get is StorageBQLoadConfig をDatastoreからGetする
func (*StorageBQLoadConfigStore) Key ¶
func (store *StorageBQLoadConfigStore) Key(ctx context.Context, client datastore.Client, bucket string) datastore.Key
Key is Create StorageBQLoadConfig Key Keyの値にはCloud StorageのBucketを利用する OCNを受け取った時に、どこにLoadするかを見るためにEntityを取得するため
func (*StorageBQLoadConfigStore) Kind ¶
func (store *StorageBQLoadConfigStore) Kind() string
Kind is Get StorageBQLoadConfigStore Kind Name
func (*StorageBQLoadConfigStore) Put ¶
func (store *StorageBQLoadConfigStore) Put(ctx context.Context, key datastore.Key, config *StorageBQLoadConfig) (*StorageBQLoadConfig, error)
Put is StorageBQLoadConfig をDatastoreにPutする
type StorageService ¶
type StorageService interface {
GetObject(ctx context.Context, bucket string, object string) (string, error)
}
StorageService is Cloud Storage Service Interface
func NewStorageService ¶
func NewStorageService() StorageService
NewStorageService is New Storage Service
type StorageServiceImpl ¶
type StorageServiceImpl struct{}
StorageServiceImpl is Default StorageService
type TQBuildQueryAPI ¶
type TQBuildQueryAPI struct{}
TQBuildQueryAPI is Build Query API
func (*TQBuildQueryAPI) Post ¶
func (api *TQBuildQueryAPI) Post(ctx context.Context, form *TQBuildQueryAPIPostRequest) (*TQBuildQueryAPIPostResponse, error)
Post is TQBuildQueryAPI Post Handler
type TQBuildQueryAPIPostRequest ¶
type TQBuildQueryAPIPostRequest struct { ProjectID string `json:"projectID"` DstProjectID string `json:"dstProjectID"` DstDatasetID string `json:"dstDatasetID"` DstTableID string `json:"dstTableID"` QueryPathBucket string `json:"queryPathBucket"` QueryPathObject string `json:"queryPathObject"` CreateDisposition string `json:"createDisposition"` TargetDate time.Time `json:"targetDate"` }
TQBuildQueryAPIPostRequest is Build Query API Post form
type TQBuildQueryAPIPostResponse ¶
type TQBuildQueryAPIPostResponse struct { }
TQBuildQueryAPIPostResponse is Build Query API Post response
type TQCloudSQLExportAPI ¶
type TQCloudSQLExportAPI struct{}
TQCloudSQLExportAPI is Cloud SQL ExportのAPIを呼び出すTask Queue API
func (*TQCloudSQLExportAPI) Call ¶
func (api *TQCloudSQLExportAPI) Call(ctx context.Context, form *TQCloudSQLExportAPIPostRequest) error
Call is Add to Cloud SQL Export Task
func (*TQCloudSQLExportAPI) Post ¶
func (api *TQCloudSQLExportAPI) Post(ctx context.Context, form *TQCloudSQLExportAPIPostRequest) error
Post is Task Queue Handler
type TQCloudSQLExportAPIAfterPostRequest ¶
type TQCloudSQLExportAPIAfterPostRequest struct { ProjectID string `json:"projectId"` Instance string `json:"instance"` Operation string `json:"operation"` JobKey string `json:"jobKey"` }
TQCloudSQLExportAPIAfterPostRequest is Request Payload
type TQCloudSQLExportAPIPostRequest ¶
type TQCloudSQLExportAPIPostRequest struct { ProjectID string `json:"projectID"` // ExportするCloudSQLが存在するProjectID Instance string `json:"instance"` // ExportするCloudSQLのInstanceID Databases []string `json:"databases"` // ExportするCloudSQLのDatabase SQLBucket string `json:"sqlBucket"` // Export時に利用するSQLを置いているGCS Bucket. hoge SQLObject string `json:"sqlObject"` // Export時に利用するSQLを置いているGCS Object. fuga.csv ExportURI string `json:"exportURI"` // Export先のGCS Path. %sを入れるとyyyyMMddhhmmに置き換える gs://hoge/%s/fuga.csv BigQueryProjectID string `json:"bigQueryProjectID"` // Load先のBigQuery ProjectID BigQueryDataset string `json:"bigQueryDataset"` // Load先のBigQuery Dataset BigQueryTable string `json:"bigQueryTable"` // Load先のBigQuery Table BigQueryTableSchema string `json:"bigQueryTableSchema"` // LoadするのBigQueryTableのSchema文字列 Ex. Name:STRING,Age:INTEGER }
TQCloudSQLExportAPIPostRequest is
type TQCloudSQLExportAfterAPI ¶
type TQCloudSQLExportAfterAPI struct{}
TQCloudSQLExportAfterAPI is Cloud SQL Export後にOPがどうなったかを確認するTask Queue API
func (*TQCloudSQLExportAfterAPI) Call ¶
func (api *TQCloudSQLExportAfterAPI) Call(ctx context.Context, form *TQCloudSQLExportAPIAfterPostRequest) error
Call is Add to Cloud SQL Export After Task
func (*TQCloudSQLExportAfterAPI) Post ¶
func (api *TQCloudSQLExportAfterAPI) Post(ctx context.Context, w http.ResponseWriter, form *TQCloudSQLExportAPIAfterPostRequest) error
Post is Task Queue Handler
type TQDatastoreExportAPI ¶
type TQDatastoreExportAPI struct { }
TQDatastoreExportAPI is Datastore Export Job Start API
func (*TQDatastoreExportAPI) Call ¶
func (api *TQDatastoreExportAPI) Call(ctx context.Context, form *TQDatastoreExportAPIPostRequest) error
Call is Add to Task
func (*TQDatastoreExportAPI) Post ¶
func (api *TQDatastoreExportAPI) Post(ctx context.Context, form *TQDatastoreExportAPIPostRequest) error
Post is Datastore Export Job Start API Handler
type TQDatastoreExportAPIPostRequest ¶
type TQDatastoreExportAPIPostRequest struct { ProjectID string `json:"projectID"` Bucket string `json:"bucket"` Kinds []string `json:"kinds"` }
TQDatastoreExportAPIPostRequest is Datastore Export Job Start API Post form
type TaskQueueService ¶
type TaskQueueService interface {
Add(ctx context.Context, task *taskqueue.Task, queueName string) (*taskqueue.Task, error)
}
TaskQueueService is TaskQueueService Interface
func NewTaskQueueService ¶
func NewTaskQueueService() TaskQueueService
NewTaskQueueService is New TaskQueueService
Source Files
¶
- batch_api.go
- bigquery.go
- bigquery_api.go
- cron_csql_export_api.go
- cron_datastore_export_api.go
- cron_query_api.go
- csql_admin.go
- csql_export_mutex_store.go
- datastore.go
- datastore_export.go
- ds2bq.go
- ocn_cloudsql_export.go
- ocn_datastore_export.go
- ocn_storage_bqload.go
- pubsub_csql_export.go
- pubsub_subscriber_sample.go
- schedule_api.go
- schedule_csql_export_api.go
- schedule_csql_export_job_store.go
- schedule_csql_export_query.go
- schedule_csql_export_store.go
- schedule_datastore_export_api.go
- schedule_datastore_export_store.go
- schedule_store.go
- storage.go
- storage_bqload_config_api.go
- storage_bqload_config_store.go
- template.go
- tq.go
- tq_build_query_api.go
- tq_csql_export_after_api.go
- tq_csql_export_api.go
- tq_datastore_export_api.go