datasource

package
v0.0.0-...-a65319e Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Insert

func Insert(id, name, pluginSrc string, data []byte, workspaceID uuid.UUID) string

Types

type DataSource

type DataSource struct {
	util.BaseModel
	Name        string     `json:"name"`
	PluginSrc   string     `json:"pluginSrc"`
	Data        []byte     `json:"data" gorm:"type:bytea"`
	WorkspaceID uuid.UUID  `json:"workspaceId"`
	DeletedAt   *time.Time `json:"-"`
}

type Main

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

func (Main) Delete

func (main Main) Delete(id string) errors.Error

func (Main) FindAllByWorkspace

func (main Main) FindAllByWorkspace(workspaceID uuid.UUID) ([]Response, errors.Error)

func (Main) FindByID

func (main Main) FindByID(id string) (Response, errors.Error)

func (Main) GetMetrics

func (main Main) GetMetrics(dataSourceID string) (datasource.MetricList, errors.Error)

func (Main) Parse

func (main Main) Parse(dataSource io.ReadCloser) (Request, errors.Error)

func (Main) Save

func (main Main) Save(dataSource Request) (Response, errors.Error)

func (Main) TestConnection

func (main Main) TestConnection(pluginSrc string, datasourceData json.RawMessage) errors.Error

func (Main) Validate

func (main Main) Validate(dataSource Request) errors.ErrorList

type Request

type Request struct {
	util.BaseModel
	Name        string          `json:"name"`
	PluginSrc   string          `json:"pluginSrc"`
	Data        json.RawMessage `json:"data"`
	WorkspaceID uuid.UUID       `json:"workspaceId"`
	DeletedAt   *time.Time      `json:"-"`
}

type Response

type Response struct {
	util.BaseModel
	Name        string          `json:"name"`
	PluginSrc   string          `json:"pluginSrc"`
	Data        json.RawMessage `json:"data"`
	WorkspaceID uuid.UUID       `json:"workspaceId"`
	DeletedAt   *time.Time      `json:"-"`
}

type UseCases

type UseCases interface {
	Parse(dataSource io.ReadCloser) (Request, errors.Error)
	FindAllByWorkspace(workspaceID uuid.UUID) ([]Response, errors.Error)
	FindByID(id string) (Response, errors.Error)
	Save(dataSource Request) (Response, errors.Error)
	Delete(id string) errors.Error
	GetMetrics(dataSourceID string) (datasource.MetricList, errors.Error)
	Validate(dataSource Request) errors.ErrorList
	TestConnection(pluginSrc string, datasourceData json.RawMessage) errors.Error
}

func NewMain

func NewMain(db *gorm.DB, pluginMain plugin.UseCases) UseCases

Jump to

Keyboard shortcuts

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