reporter

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

README

Reporter application - a simple report builder web service.

This application was build to provide end to end testing example of web service application.

Is uses mysql to register a pivot report definition, and to run reports.

Prerequisites:

Enable ssh logic you your use on your machine (on osx System Preference / Sharing / Remote Login )

Install docker service

Download endly

Provide a username and password to login to your box.

endly -c=localhost

Verify that secret file were created

cat ~/.secret/localhost.json

Create 'mysql' secret credentials, provide root as username and non empty password for docker mysqladmin

endly -c=mysql
Run reporter webservice workflow

Run the following command:

git clone https://github.com/viant/endly
cd endly/example/ws/reporter/endly/

run test with manager workflow:

endly -w=manager

run test with inline workflowrun request

endly -r=run

To check manager workflow tasks list

endly -w=manager -t='?'
 

#Troubleshooting

to check you aerospike just run

docker exec -it mydb1 mysql show tables;

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggValue

type AggValue struct {
	Name string
	Cnt  int
}

AggValue represents pivot aggregation value

type AggregatedValue

type AggregatedValue struct {
	Column   string
	Function string
}

AggregatedValue represents a pivtot report aggregated value

type AliasedColumn

type AliasedColumn struct {
	Name  string
	Alias string
}

AliasedColumn represents aliased column

type Config

type Config struct {
	RepositoryDatastore string
	Datastores          []*DatastoreConfig
}

Config represents areporter config

type DatastoreConfig

type DatastoreConfig struct {
	Name   string
	Config *dsc.Config
}

DatastoreConfig represents datastore config

type DatastoreRegistry

type DatastoreRegistry map[string]dsc.Manager

DatastoreRegistry represents a datastore datastores

func (*DatastoreRegistry) Register

func (r *DatastoreRegistry) Register(config *DatastoreConfig) error

Register register datastore config with datastore connectivity config.

type PivotReport

type PivotReport struct {
	Name string

	From string

	Values []*AggregatedValue

	Columns []*AliasedColumn

	Groups []string

	Where string
}

PivotReport represents a pivot report

func (*PivotReport) GetName

func (r *PivotReport) GetName() string

GetName returns a pivot name

func (*PivotReport) GetType

func (r *PivotReport) GetType() string

GetType returns a report type.

func (*PivotReport) SQL

func (r *PivotReport) SQL(manager dsc.Manager, parameters map[string]interface{}) (string, error)

SQL returns SQL

func (*PivotReport) Unwrap

func (r *PivotReport) Unwrap() interface{}

Unwrap unwraps pivot report

type RegisterReportRequest

type RegisterReportRequest struct {
	ReportType string
	Report     interface{}
}

RegisterReportRequest represents register request

type RegisterReportResponse

type RegisterReportResponse struct {
	*Response
}

RegisterReportResponse represents register response

type Report

type Report interface {
	GetType() string

	GetName() string

	SQL(manager dsc.Manager, parameters map[string]interface{}) (string, error)

	Unwrap() interface{}
}

Report represents a generic report

func PivotReportProvider

func PivotReportProvider(report interface{}) (Report, error)

PivotReportProvider represents pivot report provider

type ReportProvider

type ReportProvider func(report interface{}) (Report, error)

ReportProvider represents a report provider

type ReportProviders

type ReportProviders map[string]ReportProvider

ReportProviders represents a report providers

type ReportRecord

type ReportRecord struct {
	Id     int    `autoincrement:"true"`
	Name   string `column:"name"`
	Type   string `column:"type"`
	Report string `column:"report"`
}

ReportRecord represents a report record

type Reports

type Reports map[string]Report

Reports represents map of reports

type Response

type Response struct {
	Status string
	Error  string
}

Response represents generic response

type RunReportRequest

type RunReportRequest struct {
	Name       string
	Datastore  string
	Parameters map[string]interface{}
}

RunReportRequest represents run request

type RunReportResponse

type RunReportResponse struct {
	*Response
	Name    string
	Status  string
	Columns []string
	Data    []map[string]interface{}
}

RunReportResponse represents run response

type Server

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

Server represents server

func NewServer

func NewServer(port string, service Service) *Server

NewServer creates a new server

func (*Server) Start

func (s *Server) Start()

Start starts server

type Service

type Service interface {
	Register(request *RegisterReportRequest) *RegisterReportResponse

	Run(request *RunReportRequest) *RunReportResponse

	Datastores() DatastoreRegistry

	ReportProviders() ReportProviders
}

Service represents report service

func NewService

func NewService(config *Config) (Service, error)

NewService creates a new service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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