dao

package
v1.0.1-0...-b7ad348 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient() *sp.Client

The DAO client must be initiated via GetOrCreateClient() once before using GetClient().

func GetOrCreateClient

func GetOrCreateClient(ctx context.Context, dbURI string) (*sp.Client, error)

Types

type DAO

type DAO interface {
	InsertJobEntry(ctx context.Context, jobId, jobName, jobType, dialect, dbName string, jobData spanner.NullJSON) error
	UpdateJobState(ctx context.Context, jobId, state string) error
	InsertResourceEntry(ctx context.Context, resourceId, jobId, externalId, resourceName, resourceType string, resourceData spanner.NullJSON) error
	UpdateResourceState(ctx context.Context, resourceId, state string) error
	UpdateResourceExternalId(ctx context.Context, resourceId, externalId string) error
}

type DAOImpl

type DAOImpl struct{}

func (*DAOImpl) InsertJobEntry

func (dao *DAOImpl) InsertJobEntry(ctx context.Context, jobId, jobName, jobType, dialect, dbName string, jobData spanner.NullJSON) error

Insert a job entry into the SMT_JOB table.

func (*DAOImpl) InsertResourceEntry

func (dao *DAOImpl) InsertResourceEntry(ctx context.Context, resourceId, jobId, externalId, resourceName, resourceType string, resourceData spanner.NullJSON) error

Insert an entry into the SMT_RESOURCE table.

func (*DAOImpl) UpdateJobState

func (dao *DAOImpl) UpdateJobState(ctx context.Context, jobId, state string) error

Update the state of the SMT job.

func (*DAOImpl) UpdateResourceExternalId

func (dao *DAOImpl) UpdateResourceExternalId(ctx context.Context, resourceId, externalId string) error

Update the external of the SMT resource.

func (*DAOImpl) UpdateResourceState

func (dao *DAOImpl) UpdateResourceState(ctx context.Context, resourceId, state string) error

Update the state of the SMT resource.

type StateData

type StateData struct {
	State string `json:"state"`
}

Jump to

Keyboard shortcuts

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