goext

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package goext is a generated GoMock package.

Index

Constants

View Source
const (
	KeyTopLevelHandler = "top_level_handler"
)
View Source
const PriorityDefault = 0

PriorityDefault is a default handler priority

Variables

View Source
var ErrResourceNotFound = errors.New("resource not found")

ErrResourceNotFound represents 'resource not found' error

Functions

func GetContext

func GetContext(requestContext Context) context.Context

GetContext returns golang context from the goext requestContext

func IsDeadlock

func IsDeadlock(err error) bool

IsDeadlock checks if error is deadlock

Types

type Context

type Context map[string]interface{}

Context represents a context of a handler

func MakeContext

func MakeContext() Context

MakeContext creates an empty context

func (Context) Clone

func (ctx Context) Clone() Context

Clone returns copy of context

func (Context) WithISchema

func (ctx Context) WithISchema(schema ISchema) Context

WithISchema appends ISchema to given context

func (Context) WithResource

func (ctx Context) WithResource(resource Resource) Context

WithResource appends resource to given context

func (Context) WithResourceID

func (ctx Context) WithResourceID(resourceID string) Context

WithResourceID appends resource ID to given context

func (Context) WithSchemaID

func (ctx Context) WithSchemaID(schemaID SchemaID) Context

WithSchemaID appends schema ID to given context

func (Context) WithTransaction

func (ctx Context) WithTransaction(tx ITransaction) Context

WithTransaction appends transaction to given context

type CustomEvent

type CustomEvent string

type DbOptions

type DbOptions struct {
	RetryTxCount    int
	RetryTxInterval time.Duration
}

DbOptions represent database options

func DefaultDbOptions

func DefaultDbOptions() DbOptions

DefaultDbOptions returns default database options: no retries at all

type Error

type Error struct {
	Err    error
	Status int
	Origin string
}

Error represents an error code with related HTTP status

func NewError

func NewError(status int, err error) *Error

NewError returns a new error

func NewErrorAccepted

func NewErrorAccepted(err error) *Error

func NewErrorAlreadyReported

func NewErrorAlreadyReported(err error) *Error

func NewErrorBadGateway

func NewErrorBadGateway(err error) *Error

func NewErrorBadRequest

func NewErrorBadRequest(err error) *Error

4xx

func NewErrorConflict

func NewErrorConflict(err error) *Error

func NewErrorContinue

func NewErrorContinue(err error) *Error

1xx

func NewErrorCreated

func NewErrorCreated(err error) *Error

func NewErrorExpectationFailed

func NewErrorExpectationFailed(err error) *Error

func NewErrorFailedDependency

func NewErrorFailedDependency(err error) *Error

func NewErrorForbidden

func NewErrorForbidden(err error) *Error

func NewErrorFound

func NewErrorFound(err error) *Error

func NewErrorGatewayTimeout

func NewErrorGatewayTimeout(err error) *Error

func NewErrorGone

func NewErrorGone(err error) *Error

func NewErrorHTTPVersionNotSupported

func NewErrorHTTPVersionNotSupported(err error) *Error

func NewErrorIMUsed

func NewErrorIMUsed(err error) *Error

func NewErrorInsufficientStorage

func NewErrorInsufficientStorage(err error) *Error

func NewErrorInternalServerError

func NewErrorInternalServerError(err error) *Error

5xx

func NewErrorLengthRequired

func NewErrorLengthRequired(err error) *Error

func NewErrorLocked

func NewErrorLocked(err error) *Error

func NewErrorLoopDetected

func NewErrorLoopDetected(err error) *Error

func NewErrorMethodNotAllowed

func NewErrorMethodNotAllowed(err error) *Error

func NewErrorMovedPermanently

func NewErrorMovedPermanently(err error) *Error

func NewErrorMultiStatus

func NewErrorMultiStatus(err error) *Error

func NewErrorMultipleChoices

func NewErrorMultipleChoices(err error) *Error

3xx

func NewErrorNetworkAuthenticationRequired

func NewErrorNetworkAuthenticationRequired(err error) *Error

func NewErrorNoContent

func NewErrorNoContent(err error) *Error

func NewErrorNonAuthoritativeInfo

func NewErrorNonAuthoritativeInfo(err error) *Error

func NewErrorNotAcceptable

func NewErrorNotAcceptable(err error) *Error

func NewErrorNotExtended

func NewErrorNotExtended(err error) *Error

func NewErrorNotFound

func NewErrorNotFound(err error) *Error

func NewErrorNotImplemented

func NewErrorNotImplemented(err error) *Error

func NewErrorNotModified

func NewErrorNotModified(err error) *Error

func NewErrorOK

func NewErrorOK(err error) *Error

2xx

func NewErrorPartialContent

func NewErrorPartialContent(err error) *Error

func NewErrorPaymentRequired

func NewErrorPaymentRequired(err error) *Error

func NewErrorPermanentRedirect

func NewErrorPermanentRedirect(err error) *Error

func NewErrorPreconditionFailed

func NewErrorPreconditionFailed(err error) *Error

func NewErrorPreconditionRequired

func NewErrorPreconditionRequired(err error) *Error

func NewErrorProcessing

func NewErrorProcessing(err error) *Error

func NewErrorProxyAuthRequired

func NewErrorProxyAuthRequired(err error) *Error

func NewErrorRequestEntityTooLarge

func NewErrorRequestEntityTooLarge(err error) *Error

func NewErrorRequestHeaderFieldsTooLarge

func NewErrorRequestHeaderFieldsTooLarge(err error) *Error

func NewErrorRequestTimeout

func NewErrorRequestTimeout(err error) *Error

func NewErrorRequestURITooLong

func NewErrorRequestURITooLong(err error) *Error

func NewErrorRequestedRangeNotSatisfiable

func NewErrorRequestedRangeNotSatisfiable(err error) *Error

func NewErrorResetContent

func NewErrorResetContent(err error) *Error

func NewErrorSeeOther

func NewErrorSeeOther(err error) *Error

func NewErrorServiceUnavailable

func NewErrorServiceUnavailable(err error) *Error

func NewErrorSwitchingProtocols

func NewErrorSwitchingProtocols(err error) *Error

func NewErrorTeapot

func NewErrorTeapot(err error) *Error

func NewErrorTemporaryRedirect

func NewErrorTemporaryRedirect(err error) *Error

func NewErrorTooManyRequests

func NewErrorTooManyRequests(err error) *Error

func NewErrorUnauthorized

func NewErrorUnauthorized(err error) *Error

func NewErrorUnavailableForLegalReasons

func NewErrorUnavailableForLegalReasons(err error) *Error

func NewErrorUnprocessableEntity

func NewErrorUnprocessableEntity(err error) *Error

func NewErrorUnsupportedMediaType

func NewErrorUnsupportedMediaType(err error) *Error

func NewErrorUpgradeRequired

func NewErrorUpgradeRequired(err error) *Error

func NewErrorUseProxy

func NewErrorUseProxy(err error) *Error

func NewErrorVariantAlsoNegotiates

func NewErrorVariantAlsoNegotiates(err error) *Error

func (Error) Error

func (e Error) Error() string

Error returns formatted error message

func (Error) ErrorStack

func (e Error) ErrorStack() string

ErrorStack returns formatted full error stack message

func (Error) Root

func (e Error) Root() error

Root returns root error that is at the bottom of the error stack; first error that is not *goext.Error

type Event

type Event struct {
	Action   string
	Key      string
	Data     map[string]interface{}
	Revision int64
}

Event is an event from Sync

type Filter

type Filter map[string]interface{}

Filter represents filtering options for fetching functions

type Handler

type Handler func(context Context, environment IEnvironment) *Error

Handler is a generic handler

type Header map[string][]string

Header represents HTTP header

type IAuth

type IAuth interface {
	// HasRole reports whether context has given role
	HasRole(context Context, role string) bool
	// GetTenantName return name from the given context
	GetTenantName(context Context) string
	// IsAdmin reports whether context belongs to admin
	IsAdmin(context Context) bool
}

IAuth is an interface to auth in Gohan

type IConfig

type IConfig interface {
	// Config gets a parameter from config
	Config(key string, defaultValue interface{}) interface{}
}

IConfig is an interface to config in Gohan

type ICore

type ICore interface {
	// TriggerEvent causes the given event to be handled in all environments (across different-language extensions)
	TriggerEvent(event string, context Context) error
	// HandleEvent Causes the given event to be handled within the same environment
	HandleEvent(event string, context Context) error

	// RegisterEventHandler registers a global handler
	RegisterEventHandler(event string, handler Handler, priority int)
	// RegisterSchemaEventHandler registers a schema handler
	RegisterSchemaEventHandler(schemaID SchemaID, event string, schemaHandler SchemaHandler, priority int)
}

ICore is an interface to core parts of Gohan: event triggering and registering

type IDatabase

type IDatabase interface {
	// Begin starts a new transaction
	Begin() (ITransaction, error)
	// BeginTx starts a new transaction with options
	BeginTx(context Context, options *TxOptions) (ITransaction, error)

	// Options return database options from the configuration file
	Options() DbOptions

	// Within calls a function in a scoped transaction
	Within(context Context, fn func(tx ITransaction) error) error
	// WithinTx calls a function in a scoped transaction with options
	WithinTx(context Context, options *TxOptions, fn func(tx ITransaction) error) error
}

IDatabase is an interface to database in Gohan

type IEnvironment

type IEnvironment interface {

	// Config returns an implementation of IConfig interface
	Config() IConfig
	// Core returns an implementation of ICore interface
	Core() ICore
	// Logger returns an implementation of ILogger interface
	Logger() ILogger
	// Schemas returns an implementation of ISchemas interface
	Schemas() ISchemas
	// Sync returns an implementation of ISync interface
	Sync() ISync
	// Database returns an implementation of IIDatabase interface
	Database() IDatabase
	// HTTP returns an implementation of IIHTTP interface
	HTTP() IHTTP
	// Auth returns an implementation of IIAuth interface
	Auth() IAuth
	// Util returns an implementation of IIUtil interface
	Util() IUtil

	// Reset clears the environment to its initial state
	Reset()
}

IEnvironment is the only scope of Gohan available for a go extensions; other packages must not be imported nor used

type IHTTP

type IHTTP interface {
	// Request performs http request
	Request(ctx context.Context, method, rawURL string, headers map[string]interface{}, postData interface{}, opaque bool) (*Response, error)
	// RequestRaw performs raw http request
	RequestRaw(ctx context.Context, method, rawURL string, headers map[string]string, rawData string) (*Response, error)
}

IHTTP is an interface to http in Gohan

type ILogger

type ILogger interface {
	// Critical emits a critical log message
	Critical(format string)
	// Criticalf emits a formatted critical log message
	Criticalf(format string, args ...interface{})
	// Error emits an error log message
	Error(format string)
	// Errorf emits a formatted error log message
	Errorf(format string, args ...interface{})
	// Warning emits a warning log message
	Warning(format string)
	// Warningf emits a formatted warning log message
	Warningf(format string, args ...interface{})
	// Notice emits a notice log message
	Notice(format string)
	// Noticef emits a formatted notice log message
	Noticef(format string, args ...interface{})
	// Info emits an info log message
	Info(format string)
	// Infof emits a formatted info log message
	Infof(format string, args ...interface{})
	// Debug emits a debug log message
	Debug(format string)
	// Debugf emits a formatted debug log message
	Debugf(format string, args ...interface{})
}

ILogger is an interface to logger in Gohan

type IResourceBase

type IResourceBase interface {
	// Environment returns an implementation of IEnvironment interface
	Environment() IEnvironment
	// Schema returns an implementation of ISchema interface
	Schema() ISchema
	// Logger returns an implementation of ILogger interface
	Logger() ILogger
}

IResourceBase is the base class for all resources

type ISchema

type ISchema interface {
	// ID returns the identifier of this resource
	ID() SchemaID

	// List returns a list of pointers to resources derived from BaseResource
	List(filter Filter, paginator *Paginator, context Context) ([]interface{}, error)

	// ListRaw returns a list of pointers to raw resources, containing db annotations
	ListRaw(filter Filter, paginator *Paginator, context Context) ([]interface{}, error)

	// LockList returns a list of pointers to locked resources derived from BaseResource
	LockList(filter Filter, paginator *Paginator, context Context, lockPolicy LockPolicy) ([]interface{}, error)

	// LockListRaw returns a list of pointers to locked raw resources, containing db annotations
	LockListRaw(filter Filter, paginator *Paginator, context Context, lockPolicy LockPolicy) ([]interface{}, error)

	// Count returns number of resources matching the filter
	Count(filter Filter, context Context) (uint64, error)

	// Fetch returns a pointer to resource derived from BaseResource
	Fetch(id string, context Context) (interface{}, error)

	// FetchRaw returns a pointer to raw resource, containing db annotations
	FetchRaw(id string, context Context) (interface{}, error)

	// FetchFilter returns a pointer to resource derived from BaseResource
	FetchFilter(filter Filter, context Context) (interface{}, error)

	// FetchFilterRaw returns a pointer to raw resource, containing db annotations
	FetchFilterRaw(filter Filter, context Context) (interface{}, error)

	// StateFetchRaw returns a resource state
	StateFetchRaw(id string, requestContext Context) (ResourceState, error)

	// LockFetch returns a pointer to locked resource derived from BaseResource, containing db annotations
	LockFetch(id string, context Context, lockPolicy LockPolicy) (interface{}, error)

	// LockFetchRaw returns a pointer to locked raw resource, containing db annotations
	LockFetchRaw(id string, context Context, lockPolicy LockPolicy) (interface{}, error)

	// LockFetchFilter returns a pointer to locked resource derived from BaseResource, containing db annotations
	LockFetchFilter(filter Filter, context Context, lockPolicy LockPolicy) (interface{}, error)

	// LockFetchFilterRaw returns a pointer to locked raw resource, containing db annotations
	LockFetchFilterRaw(filter Filter, context Context, lockPolicy LockPolicy) (interface{}, error)

	// CreateRaw creates a raw resource, given by a pointer
	CreateRaw(rawResource interface{}, context Context) error

	// DbCreateRaw creates a raw resource, given by a pointer, no events are emitted
	DbCreateRaw(rawResource interface{}, context Context) error

	// UpdateRaw updates a raw resource, given by a pointer
	UpdateRaw(rawResource interface{}, context Context) error

	// DbUpdateRaw updates a raw resource, given by a pointer, no events are emitted
	DbUpdateRaw(rawResource interface{}, context Context) error

	// DbStateUpdateRaw updates state of a raw resource
	DbStateUpdateRaw(rawResource interface{}, context Context, state *ResourceState) error

	// DeleteRaw deletes a raw resource, given by id
	DeleteRaw(id string, context Context) error

	// DbDeleteRaw deletes a raw resource, given by id, no events are emitted
	DbDeleteRaw(id string, context Context) error

	// DeleteFilterRaw deletes a raw resource, given by a filter
	DeleteFilterRaw(filter Filter, context Context) error

	// DbDeleteFilterRaw deletes a raw resource, given by a filter, no events are emitted
	DbDeleteFilterRaw(filter Filter, context Context) error

	// RegisterResourceEventHandler registers an event handler with resource for a named event with given priority
	RegisterResourceEventHandler(event ResourceEvent, schemaHandler SchemaHandler, priority int)

	// RegisterCustomEventHandler registers an event handler without resource for a custom event with given priority
	RegisterCustomEventHandler(event CustomEvent, handler Handler, priority int)

	// RegisterType registers a resource type, derived from IResourceBase
	//
	// Deprecated: use RegisterTypes instead
	RegisterType(resourceType IResourceBase)

	// RegisterRawType registers a raw resource type, containing db annotations
	//
	// Deprecated: use RegisterTypes instead
	RegisterRawType(rawResourceType interface{})

	// RegisterTypes registers both resource types derived from IResourceBase and raw containing db annotations
	RegisterTypes(rawResourceType interface{}, resourceType IResourceBase)

	// ResourceFromMap converts mapped representation to structure representation of the raw resource registered for schema
	ResourceFromMap(context map[string]interface{}) (Resource, error)

	RawSchema() interface{}

	// DerivedSchemas returns list of schemas that extend schema with given id
	DerivedSchemas() []ISchema

	// ColumnNames generates an array that has Gohan style column names
	ColumnNames() []string

	// Properties returns properties of schema
	Properties() []Property

	// Extends return list of schema_ids which given schema extends
	Extends() []SchemaID
}

ISchema is an interface representing a single schema in Gohan

type ISchemas

type ISchemas interface {
	// List returns a list of loaded schemas
	List() []ISchema
	// Find returns a schema by id or nil if not found
	Find(id SchemaID) ISchema

	// Relations returns list of information about schema relations
	Relations(id SchemaID) []SchemaRelationInfo
}

ISchemas is an interface to schemas manager in Gohan

type ISync

type ISync interface {
	// Fetch fetches a path from sync
	Fetch(path string) (*Node, error)
	// Delete deletes a path from sync
	Delete(path string, prefix bool) error
	// Watch watches a single path in sync
	Watch(ctx context.Context, path string, timeout time.Duration, revision int64) ([]*Event, error)
	// Update updates a path with given json
	Update(path string, json string) error
}

ISync is an interface to sync in Gohan

type ITransaction

type ITransaction interface {
	// Create creates a new resource
	Create(ctx context.Context, schema ISchema, resource map[string]interface{}) error
	// Update updates an existing resource
	Update(ctx context.Context, schema ISchema, resource map[string]interface{}) error
	// StateUpdate updates state of an existing resource
	StateUpdate(ctx context.Context, schema ISchema, resource map[string]interface{}, state *ResourceState) error
	// Delete deletes an existing resource
	Delete(ctx context.Context, schema ISchema, resourceID interface{}) error
	// Fetch fetches an existing resource
	Fetch(ctx context.Context, schema ISchema, filter Filter) (map[string]interface{}, error)
	// LockFetch locks and fetches an existing resource
	LockFetch(ctx context.Context, schema ISchema, filter Filter, lockPolicy LockPolicy) (map[string]interface{}, error)
	// StateFetch fetches the state of an existing resource
	StateFetch(ctx context.Context, schema ISchema, filter Filter) (ResourceState, error)
	// List lists existing resources
	List(ctx context.Context, schema ISchema, filter Filter, listOptions *ListOptions, paginator *Paginator) ([]map[string]interface{}, uint64, error)
	// LockList locks and lists existing resources
	LockList(ctx context.Context, schema ISchema, filter Filter, listOptions *ListOptions, paginator *Paginator, lockPolicy LockPolicy) ([]map[string]interface{}, uint64, error)
	// Count returns number of resources matching the filter
	Count(ctx context.Context, schema ISchema, filter Filter) (uint64, error)
	// RawTransaction returns the raw transaction
	RawTransaction() interface{} // *sqlx.Tx
	// Query executes a query
	Query(ctx context.Context, schema ISchema, query string, args []interface{}) (list []map[string]interface{}, err error)
	// Commit performs a commit of the transaction
	Commit() error
	// Exec performs an exec in transaction
	Exec(ctx context.Context, query string, args ...interface{}) error
	// Close closes the transaction
	Close() error
	// Closed return whether the transaction is closed
	Closed() bool
	// GetIsolationLevel returns the isolation level of the transaction
	GetIsolationLevel() Type
}

ITransaction is common interface for handling transaction

type IUtil

type IUtil interface {
	// NewUUID create a new unique ID
	NewUUID() string
	// GetTransaction returns transaction from given context
	GetTransaction(context Context) (ITransaction, bool)

	// ResourceFromMapForType converts mapped representation to structure representation of the resource for given type
	ResourceFromMapForType(context map[string]interface{}, rawResource interface{}) (Resource, error)

	// ResourceToMap converts structure representation of the resource to mapped representation
	ResourceToMap(resource interface{}) map[string]interface{}
}

type Level

type Level int

Level represent logger message level

const (
	// LevelCritical indicates critical level logger message
	LevelCritical Level = iota

	// LevelError indicates error level logger message
	LevelError

	// LevelWarning indicates warning level logger message
	LevelWarning

	// LevelNotice indicates notice level logger message
	LevelNotice

	// LevelInfo indicates info level logger message
	LevelInfo

	// LevelDebug indicates debug level logger message
	LevelDebug
)

type ListOptions

type ListOptions struct {
	// Details specifies if all the underlying structures should be
	// returned.
	Details bool
	// Fields limits list output to only showing selected fields.
	Fields []string
}

ListOptions specifies additional list related options.

type LockPolicy

type LockPolicy int

LockPolicy indicates lock policy

const (
	// LockRelatedResources indicates that related resources are also locked
	LockRelatedResources LockPolicy = iota

	// SkipRelatedResources indicates that related resources are not locked
	SkipRelatedResources

	// NoLock indicates that no lock is acquired at all
	NoLock
)

type Maybe

type Maybe struct {
	MaybeState MaybeState
}

func (Maybe) HasValue

func (m Maybe) HasValue() bool

HasValue returns whether value is defined and not null

func (Maybe) IsNull

func (m Maybe) IsNull() bool

IsNull returns whether value is null

func (Maybe) IsUndefined

func (m Maybe) IsUndefined() bool

IsUndefined returns whether value is undefined

func (Maybe) String

func (m Maybe) String() string

type MaybeBool

type MaybeBool struct {
	Maybe
	// contains filtered or unexported fields
}

MaybeBool represents 3-valued bool

func MakeBool

func MakeBool(value bool) MaybeBool

MakeBool allocates a new MaybeBool and sets its value

func MakeNullBool

func MakeNullBool() MaybeBool

MakeNullBool allocates a new null bool

func MakeUndefinedBool

func MakeUndefinedBool() MaybeBool

MakeUndefinedBool allocates a new MaybeBool with undefined value

func (MaybeBool) Equals

func (mb MaybeBool) Equals(other MaybeBool) bool

Equals returns whether two maybe values are equal

func (MaybeBool) MarshalJSON

func (mb MaybeBool) MarshalJSON() ([]byte, error)

func (MaybeBool) String

func (m MaybeBool) String() string

func (*MaybeBool) UnmarshalJSON

func (mb *MaybeBool) UnmarshalJSON(b []byte) error

func (MaybeBool) Value

func (mb MaybeBool) Value() bool

type MaybeFloat

type MaybeFloat struct {
	Maybe
	// contains filtered or unexported fields
}

MaybeFloat represents 3-valued float

func MakeFloat

func MakeFloat(value float64) MaybeFloat

MakeFloat allocates a new MaybeFloat and sets its value

func MakeNullFloat

func MakeNullFloat() MaybeFloat

MakeNullFloat allocates a new null float

func MakeUndefinedFloat

func MakeUndefinedFloat() MaybeFloat

MakeUndefinedFloat allocates a new MaybeFloat with undefined value

func (MaybeFloat) Equals

func (mf MaybeFloat) Equals(other MaybeFloat) bool

Equals returns whether two maybe values are equal

func (MaybeFloat) MarshalJSON

func (mf MaybeFloat) MarshalJSON() ([]byte, error)

func (MaybeFloat) String

func (m MaybeFloat) String() string

func (*MaybeFloat) UnmarshalJSON

func (mf *MaybeFloat) UnmarshalJSON(b []byte) error

func (MaybeFloat) Value

func (mf MaybeFloat) Value() float64

type MaybeInt

type MaybeInt struct {
	Maybe
	// contains filtered or unexported fields
}

MaybeInt represents 3-valued int

func MakeInt

func MakeInt(value int) MaybeInt

MakeInt allocates a new MaybeInt and sets its value

func MakeNullInt

func MakeNullInt() MaybeInt

MakeNullInt allocates a new null integer

func MakeUndefinedInt

func MakeUndefinedInt() MaybeInt

MakeUndefinedInt allocates a new MaybeInt with undefined value

func (MaybeInt) Equals

func (this MaybeInt) Equals(other MaybeInt) bool

Equals returns whether two maybe values are equal

func (MaybeInt) MarshalJSON

func (mi MaybeInt) MarshalJSON() ([]byte, error)

func (MaybeInt) String

func (m MaybeInt) String() string

func (*MaybeInt) UnmarshalJSON

func (mi *MaybeInt) UnmarshalJSON(b []byte) error

func (MaybeInt) Value

func (mi MaybeInt) Value() int

type MaybeState

type MaybeState int
const (
	MaybeUndefined MaybeState = iota
	MaybeNull
	MaybeValue
)

type MaybeString

type MaybeString struct {
	Maybe
	// contains filtered or unexported fields
}

MaybeString represents 3-valued string

func MakeNullString

func MakeNullString() MaybeString

MakeNullString allocates a new null string

func MakeString

func MakeString(value string) MaybeString

MakeString allocates a new MaybeString and sets its value

func MakeUndefinedString

func MakeUndefinedString() MaybeString

MakeUndefinedString allocates a new MaybeString with undefined value

func (MaybeString) Equals

func (this MaybeString) Equals(other MaybeString) bool

Equals returns whether two maybe values are equal

func (MaybeString) MarshalJSON

func (ms MaybeString) MarshalJSON() ([]byte, error)

func (MaybeString) String

func (m MaybeString) String() string

func (*MaybeString) UnmarshalJSON

func (ms *MaybeString) UnmarshalJSON(b []byte) error

func (MaybeString) Value

func (ms MaybeString) Value() string

type MockIAuth

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

MockIAuth is a mock of IAuth interface

func NewMockIAuth

func NewMockIAuth(ctrl *gomock.Controller) *MockIAuth

NewMockIAuth creates a new mock instance

func (*MockIAuth) EXPECT

func (m *MockIAuth) EXPECT() *MockIAuthMockRecorder

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

func (*MockIAuth) GetTenantName

func (m *MockIAuth) GetTenantName(arg0 Context) string

GetTenantName mocks base method

func (*MockIAuth) HasRole

func (m *MockIAuth) HasRole(arg0 Context, arg1 string) bool

HasRole mocks base method

func (*MockIAuth) IsAdmin

func (m *MockIAuth) IsAdmin(arg0 Context) bool

IsAdmin mocks base method

type MockIAuthMockRecorder

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

MockIAuthMockRecorder is the mock recorder for MockIAuth

func (*MockIAuthMockRecorder) GetTenantName

func (mr *MockIAuthMockRecorder) GetTenantName(arg0 interface{}) *gomock.Call

GetTenantName indicates an expected call of GetTenantName

func (*MockIAuthMockRecorder) HasRole

func (mr *MockIAuthMockRecorder) HasRole(arg0, arg1 interface{}) *gomock.Call

HasRole indicates an expected call of HasRole

func (*MockIAuthMockRecorder) IsAdmin

func (mr *MockIAuthMockRecorder) IsAdmin(arg0 interface{}) *gomock.Call

IsAdmin indicates an expected call of IsAdmin

type MockIConfig

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

MockIConfig is a mock of IConfig interface

func NewMockIConfig

func NewMockIConfig(ctrl *gomock.Controller) *MockIConfig

NewMockIConfig creates a new mock instance

func (*MockIConfig) Config

func (m *MockIConfig) Config(arg0 string, arg1 interface{}) interface{}

Config mocks base method

func (*MockIConfig) EXPECT

func (m *MockIConfig) EXPECT() *MockIConfigMockRecorder

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

type MockIConfigMockRecorder

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

MockIConfigMockRecorder is the mock recorder for MockIConfig

func (*MockIConfigMockRecorder) Config

func (mr *MockIConfigMockRecorder) Config(arg0, arg1 interface{}) *gomock.Call

Config indicates an expected call of Config

type MockICore

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

MockICore is a mock of ICore interface

func NewMockICore

func NewMockICore(ctrl *gomock.Controller) *MockICore

NewMockICore creates a new mock instance

func (*MockICore) EXPECT

func (m *MockICore) EXPECT() *MockICoreMockRecorder

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

func (*MockICore) HandleEvent

func (m *MockICore) HandleEvent(arg0 string, arg1 Context) error

HandleEvent mocks base method

func (*MockICore) RegisterEventHandler

func (m *MockICore) RegisterEventHandler(arg0 string, arg1 Handler, arg2 int)

RegisterEventHandler mocks base method

func (*MockICore) RegisterSchemaEventHandler

func (m *MockICore) RegisterSchemaEventHandler(arg0 SchemaID, arg1 string, arg2 SchemaHandler, arg3 int)

RegisterSchemaEventHandler mocks base method

func (*MockICore) TriggerEvent

func (m *MockICore) TriggerEvent(arg0 string, arg1 Context) error

TriggerEvent mocks base method

type MockICoreMockRecorder

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

MockICoreMockRecorder is the mock recorder for MockICore

func (*MockICoreMockRecorder) HandleEvent

func (mr *MockICoreMockRecorder) HandleEvent(arg0, arg1 interface{}) *gomock.Call

HandleEvent indicates an expected call of HandleEvent

func (*MockICoreMockRecorder) RegisterEventHandler

func (mr *MockICoreMockRecorder) RegisterEventHandler(arg0, arg1, arg2 interface{}) *gomock.Call

RegisterEventHandler indicates an expected call of RegisterEventHandler

func (*MockICoreMockRecorder) RegisterSchemaEventHandler

func (mr *MockICoreMockRecorder) RegisterSchemaEventHandler(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

RegisterSchemaEventHandler indicates an expected call of RegisterSchemaEventHandler

func (*MockICoreMockRecorder) TriggerEvent

func (mr *MockICoreMockRecorder) TriggerEvent(arg0, arg1 interface{}) *gomock.Call

TriggerEvent indicates an expected call of TriggerEvent

type MockIDatabase

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

MockIDatabase is a mock of IDatabase interface

func NewMockIDatabase

func NewMockIDatabase(ctrl *gomock.Controller) *MockIDatabase

NewMockIDatabase creates a new mock instance

func (*MockIDatabase) Begin

func (m *MockIDatabase) Begin() (ITransaction, error)

Begin mocks base method

func (*MockIDatabase) BeginTx

func (m *MockIDatabase) BeginTx(arg0 Context, arg1 *TxOptions) (ITransaction, error)

BeginTx mocks base method

func (*MockIDatabase) EXPECT

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

func (*MockIDatabase) Options

func (m *MockIDatabase) Options() DbOptions

Options mocks base method

func (*MockIDatabase) Within

func (m *MockIDatabase) Within(arg0 Context, arg1 func(ITransaction) error) error

Within mocks base method

func (*MockIDatabase) WithinTx

func (m *MockIDatabase) WithinTx(arg0 Context, arg1 *TxOptions, arg2 func(ITransaction) error) error

WithinTx mocks base method

type MockIDatabaseMockRecorder

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

MockIDatabaseMockRecorder is the mock recorder for MockIDatabase

func (*MockIDatabaseMockRecorder) Begin

func (mr *MockIDatabaseMockRecorder) Begin() *gomock.Call

Begin indicates an expected call of Begin

func (*MockIDatabaseMockRecorder) BeginTx

func (mr *MockIDatabaseMockRecorder) BeginTx(arg0, arg1 interface{}) *gomock.Call

BeginTx indicates an expected call of BeginTx

func (*MockIDatabaseMockRecorder) Options

func (mr *MockIDatabaseMockRecorder) Options() *gomock.Call

Options indicates an expected call of Options

func (*MockIDatabaseMockRecorder) Within

func (mr *MockIDatabaseMockRecorder) Within(arg0, arg1 interface{}) *gomock.Call

Within indicates an expected call of Within

func (*MockIDatabaseMockRecorder) WithinTx

func (mr *MockIDatabaseMockRecorder) WithinTx(arg0, arg1, arg2 interface{}) *gomock.Call

WithinTx indicates an expected call of WithinTx

type MockIEnvironment

type MockIEnvironment interface {
	IEnvironment
	SetMockModules(modules MockModules)
	GetController() *gomock.Controller
	MockCore() *MockICore
	MockLogger() *MockILogger
	MockSchemas() *MockISchemas
	MockSync() *MockISync
	MockDatabase() *MockIDatabase
	MockHttp() *MockIHTTP
	MockAuth() *MockIAuth
	MockConfig() *MockIConfig
	MockUtil() *MockIUtil
}

MockIEnvironment is the only scope of Gohan available for a go unit tests extensions; it should not be used outside unit tests

type MockIHTTP

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

MockIHTTP is a mock of IHTTP interface

func NewMockIHTTP

func NewMockIHTTP(ctrl *gomock.Controller) *MockIHTTP

NewMockIHTTP creates a new mock instance

func (*MockIHTTP) EXPECT

func (m *MockIHTTP) EXPECT() *MockIHTTPMockRecorder

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

func (*MockIHTTP) Request

func (m *MockIHTTP) Request(arg0 context.Context, arg1, arg2 string, arg3 map[string]interface{}, arg4 interface{}, arg5 bool) (*Response, error)

Request mocks base method

func (*MockIHTTP) RequestRaw

func (m *MockIHTTP) RequestRaw(arg0 context.Context, arg1, arg2 string, arg3 map[string]string, arg4 string) (*Response, error)

RequestRaw mocks base method

type MockIHTTPMockRecorder

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

MockIHTTPMockRecorder is the mock recorder for MockIHTTP

func (*MockIHTTPMockRecorder) Request

func (mr *MockIHTTPMockRecorder) Request(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

Request indicates an expected call of Request

func (*MockIHTTPMockRecorder) RequestRaw

func (mr *MockIHTTPMockRecorder) RequestRaw(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

RequestRaw indicates an expected call of RequestRaw

type MockILogger

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

MockILogger is a mock of ILogger interface

func NewMockILogger

func NewMockILogger(ctrl *gomock.Controller) *MockILogger

NewMockILogger creates a new mock instance

func (*MockILogger) Critical

func (m *MockILogger) Critical(arg0 string)

Critical mocks base method

func (*MockILogger) Criticalf

func (m *MockILogger) Criticalf(arg0 string, arg1 ...interface{})

Criticalf mocks base method

func (*MockILogger) Debug

func (m *MockILogger) Debug(arg0 string)

Debug mocks base method

func (*MockILogger) Debugf

func (m *MockILogger) Debugf(arg0 string, arg1 ...interface{})

Debugf mocks base method

func (*MockILogger) EXPECT

func (m *MockILogger) EXPECT() *MockILoggerMockRecorder

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

func (*MockILogger) Error

func (m *MockILogger) Error(arg0 string)

Error mocks base method

func (*MockILogger) Errorf

func (m *MockILogger) Errorf(arg0 string, arg1 ...interface{})

Errorf mocks base method

func (*MockILogger) Info

func (m *MockILogger) Info(arg0 string)

Info mocks base method

func (*MockILogger) Infof

func (m *MockILogger) Infof(arg0 string, arg1 ...interface{})

Infof mocks base method

func (*MockILogger) Notice

func (m *MockILogger) Notice(arg0 string)

Notice mocks base method

func (*MockILogger) Noticef

func (m *MockILogger) Noticef(arg0 string, arg1 ...interface{})

Noticef mocks base method

func (*MockILogger) Warning

func (m *MockILogger) Warning(arg0 string)

Warning mocks base method

func (*MockILogger) Warningf

func (m *MockILogger) Warningf(arg0 string, arg1 ...interface{})

Warningf mocks base method

type MockILoggerMockRecorder

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

MockILoggerMockRecorder is the mock recorder for MockILogger

func (*MockILoggerMockRecorder) Critical

func (mr *MockILoggerMockRecorder) Critical(arg0 interface{}) *gomock.Call

Critical indicates an expected call of Critical

func (*MockILoggerMockRecorder) Criticalf

func (mr *MockILoggerMockRecorder) Criticalf(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Criticalf indicates an expected call of Criticalf

func (*MockILoggerMockRecorder) Debug

func (mr *MockILoggerMockRecorder) Debug(arg0 interface{}) *gomock.Call

Debug indicates an expected call of Debug

func (*MockILoggerMockRecorder) Debugf

func (mr *MockILoggerMockRecorder) Debugf(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Debugf indicates an expected call of Debugf

func (*MockILoggerMockRecorder) Error

func (mr *MockILoggerMockRecorder) Error(arg0 interface{}) *gomock.Call

Error indicates an expected call of Error

func (*MockILoggerMockRecorder) Errorf

func (mr *MockILoggerMockRecorder) Errorf(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Errorf indicates an expected call of Errorf

func (*MockILoggerMockRecorder) Info

func (mr *MockILoggerMockRecorder) Info(arg0 interface{}) *gomock.Call

Info indicates an expected call of Info

func (*MockILoggerMockRecorder) Infof

func (mr *MockILoggerMockRecorder) Infof(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Infof indicates an expected call of Infof

func (*MockILoggerMockRecorder) Notice

func (mr *MockILoggerMockRecorder) Notice(arg0 interface{}) *gomock.Call

Notice indicates an expected call of Notice

func (*MockILoggerMockRecorder) Noticef

func (mr *MockILoggerMockRecorder) Noticef(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Noticef indicates an expected call of Noticef

func (*MockILoggerMockRecorder) Warning

func (mr *MockILoggerMockRecorder) Warning(arg0 interface{}) *gomock.Call

Warning indicates an expected call of Warning

func (*MockILoggerMockRecorder) Warningf

func (mr *MockILoggerMockRecorder) Warningf(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Warningf indicates an expected call of Warningf

type MockISchemas

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

MockISchemas is a mock of ISchemas interface

func NewMockISchemas

func NewMockISchemas(ctrl *gomock.Controller) *MockISchemas

NewMockISchemas creates a new mock instance

func (*MockISchemas) EXPECT

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

func (*MockISchemas) Find

func (m *MockISchemas) Find(arg0 SchemaID) ISchema

Find mocks base method

func (*MockISchemas) List

func (m *MockISchemas) List() []ISchema

List mocks base method

func (*MockISchemas) Relations

func (m *MockISchemas) Relations(arg0 SchemaID) []SchemaRelationInfo

Relations mocks base method

type MockISchemasMockRecorder

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

MockISchemasMockRecorder is the mock recorder for MockISchemas

func (*MockISchemasMockRecorder) Find

func (mr *MockISchemasMockRecorder) Find(arg0 interface{}) *gomock.Call

Find indicates an expected call of Find

func (*MockISchemasMockRecorder) List

func (mr *MockISchemasMockRecorder) List() *gomock.Call

List indicates an expected call of List

func (*MockISchemasMockRecorder) Relations

func (mr *MockISchemasMockRecorder) Relations(arg0 interface{}) *gomock.Call

Relations indicates an expected call of Relations

type MockISync

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

MockISync is a mock of ISync interface

func NewMockISync

func NewMockISync(ctrl *gomock.Controller) *MockISync

NewMockISync creates a new mock instance

func (*MockISync) Delete

func (m *MockISync) Delete(arg0 string, arg1 bool) error

Delete mocks base method

func (*MockISync) EXPECT

func (m *MockISync) EXPECT() *MockISyncMockRecorder

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

func (*MockISync) Fetch

func (m *MockISync) Fetch(arg0 string) (*Node, error)

Fetch mocks base method

func (*MockISync) Update

func (m *MockISync) Update(arg0, arg1 string) error

Update mocks base method

func (*MockISync) Watch

func (m *MockISync) Watch(arg0 context.Context, arg1 string, arg2 time.Duration, arg3 int64) ([]*Event, error)

Watch mocks base method

type MockISyncMockRecorder

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

MockISyncMockRecorder is the mock recorder for MockISync

func (*MockISyncMockRecorder) Delete

func (mr *MockISyncMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockISyncMockRecorder) Fetch

func (mr *MockISyncMockRecorder) Fetch(arg0 interface{}) *gomock.Call

Fetch indicates an expected call of Fetch

func (*MockISyncMockRecorder) Update

func (mr *MockISyncMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update

func (*MockISyncMockRecorder) Watch

func (mr *MockISyncMockRecorder) Watch(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Watch indicates an expected call of Watch

type MockITransaction

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

MockITransaction is a mock of ITransaction interface

func NewMockITransaction

func NewMockITransaction(ctrl *gomock.Controller) *MockITransaction

NewMockITransaction creates a new mock instance

func (*MockITransaction) Close

func (m *MockITransaction) Close() error

Close mocks base method

func (*MockITransaction) Closed

func (m *MockITransaction) Closed() bool

Closed mocks base method

func (*MockITransaction) Commit

func (m *MockITransaction) Commit() error

Commit mocks base method

func (*MockITransaction) Count

func (m *MockITransaction) Count(arg0 context.Context, arg1 ISchema, arg2 Filter) (uint64, error)

Count mocks base method

func (*MockITransaction) Create

func (m *MockITransaction) Create(arg0 context.Context, arg1 ISchema, arg2 map[string]interface{}) error

Create mocks base method

func (*MockITransaction) Delete

func (m *MockITransaction) Delete(arg0 context.Context, arg1 ISchema, arg2 interface{}) error

Delete mocks base method

func (*MockITransaction) EXPECT

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

func (*MockITransaction) Exec

func (m *MockITransaction) Exec(arg0 context.Context, arg1 string, arg2 ...interface{}) error

Exec mocks base method

func (*MockITransaction) Fetch

func (m *MockITransaction) Fetch(arg0 context.Context, arg1 ISchema, arg2 Filter) (map[string]interface{}, error)

Fetch mocks base method

func (*MockITransaction) GetIsolationLevel

func (m *MockITransaction) GetIsolationLevel() Type

GetIsolationLevel mocks base method

func (*MockITransaction) List

func (m *MockITransaction) List(arg0 context.Context, arg1 ISchema, arg2 Filter, arg3 *ListOptions, arg4 *Paginator) ([]map[string]interface{}, uint64, error)

List mocks base method

func (*MockITransaction) LockFetch

func (m *MockITransaction) LockFetch(arg0 context.Context, arg1 ISchema, arg2 Filter, arg3 LockPolicy) (map[string]interface{}, error)

LockFetch mocks base method

func (*MockITransaction) LockList

func (m *MockITransaction) LockList(arg0 context.Context, arg1 ISchema, arg2 Filter, arg3 *ListOptions, arg4 *Paginator, arg5 LockPolicy) ([]map[string]interface{}, uint64, error)

LockList mocks base method

func (*MockITransaction) Query

func (m *MockITransaction) Query(arg0 context.Context, arg1 ISchema, arg2 string, arg3 []interface{}) ([]map[string]interface{}, error)

Query mocks base method

func (*MockITransaction) RawTransaction

func (m *MockITransaction) RawTransaction() interface{}

RawTransaction mocks base method

func (*MockITransaction) StateFetch

func (m *MockITransaction) StateFetch(arg0 context.Context, arg1 ISchema, arg2 Filter) (ResourceState, error)

StateFetch mocks base method

func (*MockITransaction) StateUpdate

func (m *MockITransaction) StateUpdate(arg0 context.Context, arg1 ISchema, arg2 map[string]interface{}, arg3 *ResourceState) error

StateUpdate mocks base method

func (*MockITransaction) Update

func (m *MockITransaction) Update(arg0 context.Context, arg1 ISchema, arg2 map[string]interface{}) error

Update mocks base method

type MockITransactionMockRecorder

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

MockITransactionMockRecorder is the mock recorder for MockITransaction

func (*MockITransactionMockRecorder) Close

Close indicates an expected call of Close

func (*MockITransactionMockRecorder) Closed

Closed indicates an expected call of Closed

func (*MockITransactionMockRecorder) Commit

Commit indicates an expected call of Commit

func (*MockITransactionMockRecorder) Count

func (mr *MockITransactionMockRecorder) Count(arg0, arg1, arg2 interface{}) *gomock.Call

Count indicates an expected call of Count

func (*MockITransactionMockRecorder) Create

func (mr *MockITransactionMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockITransactionMockRecorder) Delete

func (mr *MockITransactionMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockITransactionMockRecorder) Exec

func (mr *MockITransactionMockRecorder) Exec(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

Exec indicates an expected call of Exec

func (*MockITransactionMockRecorder) Fetch

func (mr *MockITransactionMockRecorder) Fetch(arg0, arg1, arg2 interface{}) *gomock.Call

Fetch indicates an expected call of Fetch

func (*MockITransactionMockRecorder) GetIsolationLevel

func (mr *MockITransactionMockRecorder) GetIsolationLevel() *gomock.Call

GetIsolationLevel indicates an expected call of GetIsolationLevel

func (*MockITransactionMockRecorder) List

func (mr *MockITransactionMockRecorder) List(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

List indicates an expected call of List

func (*MockITransactionMockRecorder) LockFetch

func (mr *MockITransactionMockRecorder) LockFetch(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

LockFetch indicates an expected call of LockFetch

func (*MockITransactionMockRecorder) LockList

func (mr *MockITransactionMockRecorder) LockList(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

LockList indicates an expected call of LockList

func (*MockITransactionMockRecorder) Query

func (mr *MockITransactionMockRecorder) Query(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Query indicates an expected call of Query

func (*MockITransactionMockRecorder) RawTransaction

func (mr *MockITransactionMockRecorder) RawTransaction() *gomock.Call

RawTransaction indicates an expected call of RawTransaction

func (*MockITransactionMockRecorder) StateFetch

func (mr *MockITransactionMockRecorder) StateFetch(arg0, arg1, arg2 interface{}) *gomock.Call

StateFetch indicates an expected call of StateFetch

func (*MockITransactionMockRecorder) StateUpdate

func (mr *MockITransactionMockRecorder) StateUpdate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

StateUpdate indicates an expected call of StateUpdate

func (*MockITransactionMockRecorder) Update

func (mr *MockITransactionMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call

Update indicates an expected call of Update

type MockIUtil

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

MockIUtil is a mock of IUtil interface

func NewMockIUtil

func NewMockIUtil(ctrl *gomock.Controller) *MockIUtil

NewMockIUtil creates a new mock instance

func (*MockIUtil) EXPECT

func (m *MockIUtil) EXPECT() *MockIUtilMockRecorder

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

func (*MockIUtil) GetTransaction

func (m *MockIUtil) GetTransaction(arg0 Context) (ITransaction, bool)

GetTransaction mocks base method

func (*MockIUtil) NewUUID

func (m *MockIUtil) NewUUID() string

NewUUID mocks base method

func (*MockIUtil) ResourceFromMapForType

func (m *MockIUtil) ResourceFromMapForType(arg0 map[string]interface{}, arg1 interface{}) (Resource, error)

ResourceFromMapForType mocks base method

func (*MockIUtil) ResourceToMap

func (m *MockIUtil) ResourceToMap(arg0 interface{}) map[string]interface{}

ResourceToMap mocks base method

type MockIUtilMockRecorder

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

MockIUtilMockRecorder is the mock recorder for MockIUtil

func (*MockIUtilMockRecorder) GetTransaction

func (mr *MockIUtilMockRecorder) GetTransaction(arg0 interface{}) *gomock.Call

GetTransaction indicates an expected call of GetTransaction

func (*MockIUtilMockRecorder) NewUUID

func (mr *MockIUtilMockRecorder) NewUUID() *gomock.Call

NewUUID indicates an expected call of NewUUID

func (*MockIUtilMockRecorder) ResourceFromMapForType

func (mr *MockIUtilMockRecorder) ResourceFromMapForType(arg0, arg1 interface{}) *gomock.Call

ResourceFromMapForType indicates an expected call of ResourceFromMapForType

func (*MockIUtilMockRecorder) ResourceToMap

func (mr *MockIUtilMockRecorder) ResourceToMap(arg0 interface{}) *gomock.Call

ResourceToMap indicates an expected call of ResourceToMap

type MockModules

type MockModules struct {
	Core, Logger, Schemas, Sync, Database, Http, Auth, Util, Config, DefaultDatabase bool
}

MockModules indicates modules which should be mocked. By default none of the modules are mocked so that MockIEnvironment behaves exactly the same as IEnvironment.

type Node

type Node struct {
	Key      string
	Value    string
	Revision int64
	Children []*Node
}

Node is a node from Sync

type OptionPaginator

type OptionPaginator func(*Paginator)

Below code is adapted from similar code in db/pagination/pagination.go, but doesn't validate parameters.

func OptionKey

func OptionKey(key string) OptionPaginator

func OptionLimit

func OptionLimit(limit uint64) OptionPaginator

func OptionOffset

func OptionOffset(offset uint64) OptionPaginator

func OptionOrder

func OptionOrder(order string) OptionPaginator

type Paginator

type Paginator struct {
	Key    string
	Order  string
	Limit  uint64
	Offset uint64
}

Paginator represents a paginator

func NewPaginator

func NewPaginator(options ...OptionPaginator) *Paginator

NewPaginator create Paginator

type Property

type Property struct {
	ID       string
	Title    string
	Relation SchemaID
	Type     string
}

Property represents schema property

type Resource

type Resource interface{}

Resource represents a resource

type ResourceBase

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

ResourceBase is the implementation of base class for all resources

func NewResourceBase

func NewResourceBase(env IEnvironment, schema ISchema, logger ILogger) *ResourceBase

NewResourceBase allocates a new ResourceBase with the given environment, schema and logger

func (*ResourceBase) Environment

func (resourceBase *ResourceBase) Environment() IEnvironment

Environment returns an implementation of IEnvironment interface

func (*ResourceBase) Logger

func (resourceBase *ResourceBase) Logger() ILogger

Logger returns an implementation of ILogger interface

func (*ResourceBase) Schema

func (resourceBase *ResourceBase) Schema() ISchema

Schema returns an implementation of ISchema interface

type ResourceEvent

type ResourceEvent string
const (
	PreCreate    ResourceEvent = "pre_create"
	PreCreateTx  ResourceEvent = "pre_create_in_transaction"
	PostCreateTx ResourceEvent = "post_create_in_transaction"
	PostCreate   ResourceEvent = "post_create"

	PreUpdate    ResourceEvent = "pre_update"
	PreUpdateTx  ResourceEvent = "pre_update_in_transaction"
	PostUpdateTx ResourceEvent = "post_update_in_transaction"
	PostUpdate   ResourceEvent = "post_update"

	PreShow    ResourceEvent = "pre_show"
	PreShowTx  ResourceEvent = "pre_show_in_transaction"
	PostShowTx ResourceEvent = "post_show_in_transaction"
	PostShow   ResourceEvent = "post_show"

	PreList    ResourceEvent = "pre_list"
	PreListTx  ResourceEvent = "pre_list_in_transaction"
	PostListTx ResourceEvent = "post_list_in_transaction"
	PostList   ResourceEvent = "post_list"

	PreDelete    ResourceEvent = "pre_delete"
	PreDeleteTx  ResourceEvent = "pre_delete_in_transaction"
	PostDeleteTx ResourceEvent = "post_delete_in_transaction"
	PostDelete   ResourceEvent = "post_delete"
)

Built-in handler types

type ResourceState

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

ResourceState represents the state of a resource

type Resources

type Resources []Resource

Resources is a list of resources

type Response

type Response struct {
	Code   int
	Status string
	Header Header
	Body   string
}

Response represents HTTP response

type SchemaHandler

type SchemaHandler func(context Context, resource Resource, environment IEnvironment) *Error

SchemaHandler is a schema handler

type SchemaID

type SchemaID string

SchemaID is a type for schema ID

type SchemaRelationInfo

type SchemaRelationInfo struct {
	// SchemaID relation to which schema
	SchemaID SchemaID
	// PropertyID ID of property which relation is referenced
	PropertyID string
	// OnDeleteCascade whether cascading delete on related resource delete is enabled
	OnDeleteCascade bool
}

SchemaRelationInfo describes schema relation

type TxOptions

type TxOptions struct {
	IsolationLevel Type
}

TxOptions represents transaction options

type Type

type Type string

Type represents transaction types

const (
	//ReadUncommitted is transaction type for READ UNCOMMITTED
	//You don't need to use this for most case
	ReadUncommitted 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"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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