query

package
v0.0.0-...-b88831b Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitQueryHandler

func InitQueryHandler(store Store, os os.Handler)

func NewLocalQueryStore

func NewLocalQueryStore() *localQueryStore

Types

type Handler

type Handler interface {
	RunSavedQuery(string) (ResultDTO, error)
	RunCustomQuery(string) (ResultDTO, error)
	// contains filtered or unexported methods
}

type MockQueryHandler

type MockQueryHandler struct {
	mock.Mock
}

func (*MockQueryHandler) RunCustomQuery

func (mq *MockQueryHandler) RunCustomQuery(query string) (ResultDTO, error)

func (*MockQueryHandler) RunSavedQuery

func (mq *MockQueryHandler) RunSavedQuery(name string) (ResultDTO, error)

type MockQueryStore

type MockQueryStore struct {
	mock.Mock
}

func (*MockQueryStore) AddQueries

func (m *MockQueryStore) AddQueries(queries map[string]string)

func (*MockQueryStore) AddQuery

func (m *MockQueryStore) AddQuery(name, query string)

func (*MockQueryStore) GetQuery

func (m *MockQueryStore) GetQuery(name string) (string, bool)

func (*MockQueryStore) HasQuery

func (m *MockQueryStore) HasQuery(name string) bool

type ResultDTO

type ResultDTO struct {
	Arguments map[string]string
}

func (ResultDTO) GetField

func (r ResultDTO) GetField(field string) string

func (ResultDTO) HasField

func (r ResultDTO) HasField(field string) bool

func (*ResultDTO) UnmarshalArguments

func (r *ResultDTO) UnmarshalArguments(rawMessage []byte) error

type StdHandler

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

func GetQueryHandler

func GetQueryHandler() *StdHandler

func (StdHandler) RunCustomQuery

func (qh StdHandler) RunCustomQuery(query string) (ResultDTO, error)

func (StdHandler) RunSavedQuery

func (qh StdHandler) RunSavedQuery(name string) (ResultDTO, error)

type Store

type Store interface {
	GetQuery(name string) (string, bool)
	HasQuery(name string) bool
	AddQueries(queries map[string]string)
	AddQuery(name, query string)
}

Jump to

Keyboard shortcuts

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