queryhistory

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrQueryNotFound        = errors.New("query in query history not found")
	ErrStarredQueryNotFound = errors.New("starred query not found")
	ErrQueryAlreadyStarred  = errors.New("query was already starred")
)

Functions

This section is empty.

Types

type CreateQueryInQueryHistoryCommand

type CreateQueryInQueryHistoryCommand struct {
	DatasourceUID string           `json:"datasourceUid"`
	Queries       *simplejson.Json `json:"queries"`
}

type DeleteQueryFromQueryHistoryResponse

type DeleteQueryFromQueryHistoryResponse struct {
	ID      int64  `json:"id"`
	Message string `json:"message"`
}

DeleteQueryFromQueryHistoryResponse is the response struct for deleting a query from query history

type PatchQueryCommentInQueryHistoryCommand

type PatchQueryCommentInQueryHistoryCommand struct {
	Comment string `json:"comment"`
}

type QueryHistory

type QueryHistory struct {
	ID            int64  `xorm:"pk autoincr 'id'"`
	UID           string `xorm:"uid"`
	DatasourceUID string `xorm:"datasource_uid"`
	OrgID         int64  `xorm:"org_id"`
	CreatedBy     int64
	CreatedAt     int64
	Comment       string
	Queries       *simplejson.Json
}

type QueryHistoryDTO

type QueryHistoryDTO struct {
	UID           string           `json:"uid" xorm:"uid"`
	DatasourceUID string           `json:"datasourceUid" xorm:"datasource_uid"`
	CreatedBy     int64            `json:"createdBy"`
	CreatedAt     int64            `json:"createdAt"`
	Comment       string           `json:"comment"`
	Queries       *simplejson.Json `json:"queries"`
	Starred       bool             `json:"starred"`
}

type QueryHistoryResponse

type QueryHistoryResponse struct {
	Result QueryHistoryDTO `json:"result"`
}

QueryHistoryResponse is a response struct for QueryHistoryDTO

type QueryHistorySearchResponse

type QueryHistorySearchResponse struct {
	Result QueryHistorySearchResult `json:"result"`
}

type QueryHistorySearchResult

type QueryHistorySearchResult struct {
	TotalCount   int               `json:"totalCount"`
	QueryHistory []QueryHistoryDTO `json:"queryHistory"`
	Page         int               `json:"page"`
	PerPage      int               `json:"perPage"`
}

type QueryHistoryService

type QueryHistoryService struct {
	SQLStore      *sqlstore.SQLStore
	Cfg           *setting.Cfg
	RouteRegister routing.RouteRegister
	// contains filtered or unexported fields
}

func ProvideService

func ProvideService(cfg *setting.Cfg, sqlStore *sqlstore.SQLStore, routeRegister routing.RouteRegister) *QueryHistoryService

func (QueryHistoryService) CreateQueryInQueryHistory

func (QueryHistoryService) DeleteQueryFromQueryHistory

func (s QueryHistoryService) DeleteQueryFromQueryHistory(ctx context.Context, user *models.SignedInUser, UID string) (int64, error)

func (QueryHistoryService) PatchQueryCommentInQueryHistory

func (QueryHistoryService) SearchInQueryHistory

func (QueryHistoryService) StarQueryInQueryHistory

func (s QueryHistoryService) StarQueryInQueryHistory(ctx context.Context, user *models.SignedInUser, UID string) (QueryHistoryDTO, error)

func (QueryHistoryService) UnstarQueryInQueryHistory

func (s QueryHistoryService) UnstarQueryInQueryHistory(ctx context.Context, user *models.SignedInUser, UID string) (QueryHistoryDTO, error)

type QueryHistoryStar

type QueryHistoryStar struct {
	ID       int64  `xorm:"pk autoincr 'id'"`
	QueryUID string `xorm:"query_uid"`
	UserID   int64  `xorm:"user_id"`
}

type SearchInQueryHistoryQuery

type SearchInQueryHistoryQuery struct {
	DatasourceUIDs []string `json:"datasourceUids"`
	SearchString   string   `json:"searchString"`
	OnlyStarred    bool     `json:"onlyStarred"`
	Sort           string   `json:"sort"`
	Page           int      `json:"page"`
	Limit          int      `json:"limit"`
}

type Service

type Service interface {
	CreateQueryInQueryHistory(ctx context.Context, user *models.SignedInUser, cmd CreateQueryInQueryHistoryCommand) (QueryHistoryDTO, error)
	SearchInQueryHistory(ctx context.Context, user *models.SignedInUser, query SearchInQueryHistoryQuery) (QueryHistorySearchResult, error)
	DeleteQueryFromQueryHistory(ctx context.Context, user *models.SignedInUser, UID string) (int64, error)
	PatchQueryCommentInQueryHistory(ctx context.Context, user *models.SignedInUser, UID string, cmd PatchQueryCommentInQueryHistoryCommand) (QueryHistoryDTO, error)
	StarQueryInQueryHistory(ctx context.Context, user *models.SignedInUser, UID string) (QueryHistoryDTO, error)
	UnstarQueryInQueryHistory(ctx context.Context, user *models.SignedInUser, UID string) (QueryHistoryDTO, error)
}

Jump to

Keyboard shortcuts

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