mysql

package
v0.0.0-...-6e34d32 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CceDB

type CceDB interface {
	Ping() error
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
}

type PersistenceService

type PersistenceService struct {
	DB CceDB
}

PersistenceService implements cce.PersistenceService.

func (*PersistenceService) BulkUpdate

func (s *PersistenceService) BulkUpdate(
	ctx context.Context,
	es []cce.Persistable,
) error

BulkUpdate updates multiple resources.

func (*PersistenceService) Create

func (s *PersistenceService) Create(
	ctx context.Context,
	e cce.Persistable,
) error

Create persists a resource.

func (*PersistenceService) Delete

func (s *PersistenceService) Delete(
	ctx context.Context,
	id string,
	zv cce.Persistable,
) (ok bool, err error)

Delete deletes a resource of the given type.

func (*PersistenceService) Filter

func (s *PersistenceService) Filter(
	ctx context.Context,
	zv cce.Filterable,
	fs []cce.Filter,
) (es []cce.Persistable, err error)

Filter retrieves a collection of resources of the given type using a set of filters.

func (*PersistenceService) Read

func (s *PersistenceService) Read(
	ctx context.Context,
	id string,
	zv cce.Persistable,
) (e cce.Persistable, err error)

Read retrieves a single resource of the given type by ID.

func (*PersistenceService) ReadAll

func (s *PersistenceService) ReadAll(
	ctx context.Context,
	zv cce.Persistable,
) (es []cce.Persistable, err error)

ReadAll retrieves all resources of the given type.

Jump to

Keyboard shortcuts

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