transaction

package
v0.0.0-...-30e45d9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter map[string]interface{}

Filter represents db filter

func IDFilter

func IDFilter(ID interface{}) Filter

IDFilter create filter for specific ID

type ResourceState

type ResourceState struct {
	ConfigVersion int64
	StateVersion  int64
	Error         string
	State         string
	Monitoring    string
}

ResourceState represents the state of a resource

type Transaction

type Transaction interface {
	Create(*schema.Resource) error
	Update(*schema.Resource) error
	SetIsolationLevel(Type) error
	StateUpdate(*schema.Resource, *ResourceState) error
	Delete(*schema.Schema, interface{}) error
	Fetch(*schema.Schema, Filter) (*schema.Resource, error)
	StateFetch(*schema.Schema, Filter) (ResourceState, error)
	List(*schema.Schema, Filter, *pagination.Paginator) ([]*schema.Resource, uint64, error)
	RawTransaction() *sqlx.Tx
	Query(*schema.Schema, string, []interface{}) (list []*schema.Resource, err error)
	Commit() error
	Exec(query string, args ...interface{}) error
	Close() error
	Closed() bool
}

Transaction is common interface for handing transaction

type Type

type Type string

Type represents transaction types

const (
	//ReadUncommited is transaction type for READ UNCOMMITTED
	//You don't need to use this for most case
	ReadUncommited Type = "READ UNCOMMITTED"
	//ReadCommited is transaction type for READ COMMITTED
	//You don't need to use this for most case
	ReadCommited Type = "READ COMMITTED"
	//RepeatableRead is transaction type for REPEATABLE READ
	//This is default value for read request
	RepeatableRead Type = "REPEATABLE READ"
	//Serializable is transaction type for Serializable
	Serializable Type = "Serializable"
)

func GetIsolationLevel

func GetIsolationLevel(s *schema.Schema, action string) Type

GetIsolationLevel returns isolation level for an action

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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