scripts

package
v0.0.0-...-a12d374 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbContext

type DbContext interface {
	GetScriptsRepository(projectID string) (Repository, error)
}

type Execution

type Execution struct {
	Query  string                 `json:"query"`
	Params map[string]interface{} `json:"params"`
}

type Identity

type Identity struct {
	ProjectID string `json:"project_id"`
	ScriptID  string `json:"script_id"`
}

type Persistence

type Persistence struct {
	Enabled bool `json:"enabled"`
}

type QueryResult

type QueryResult struct {
	dal.QueryResult
	Data []ScriptEntity
}

type Repository

type Repository interface {
	Get(ctx context.Context, id string) (ScriptEntity, error)

	Find(ctx context.Context, query dal.Query) (QueryResult, error)

	Create(ctx context.Context, script Script) (dal.Entity, error)

	Update(ctx context.Context, script UpdateScript) (dal.Entity, error)

	Delete(ctx context.Context, id string) error
}

type Script

type Script struct {
	dal.Definition
	Execution   Execution   `json:"execution"`
	Persistence Persistence `json:"persistence"`
}

type ScriptEntity

type ScriptEntity struct {
	dal.Entity
	Script
}

type Service

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

func NewService

func NewService(db DbContext) (*Service, error)

func (*Service) CreateScript

func (service *Service) CreateScript(ctx context.Context, projectID string, script Script) (dal.Entity, error)

func (*Service) DeleteScript

func (service *Service) DeleteScript(ctx context.Context, projectID, id string) error

func (*Service) FindScripts

func (service *Service) FindScripts(ctx context.Context, projectID string, q dal.Query) (QueryResult, error)

func (*Service) GetScript

func (service *Service) GetScript(ctx context.Context, projectID, id string) (ScriptEntity, error)

func (*Service) UpdateScript

func (service *Service) UpdateScript(ctx context.Context, projectID string, script UpdateScript) (dal.Entity, error)

type UpdateScript

type UpdateScript struct {
	Script
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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