surveys

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByFilename

type ByFilename []LauncherSchema

ByFilename implements sort.Interface based on the Name field.

func (ByFilename) Len

func (a ByFilename) Len() int

func (ByFilename) Less

func (a ByFilename) Less(i, j int) bool

func (ByFilename) Swap

func (a ByFilename) Swap(i, j int)

type LauncherSchema

type LauncherSchema struct {
	Name       string
	EqID       string
	FormType   string
	URL        string
	BodyParams ReqVersionBodyParams
}

LauncherSchema is a representation of a schema in the Launcher

func FindSurveyByName

func FindSurveyByName(name string) LauncherSchema

FindSurveyByName Finds the schema in the list of available schemas

func GetAvailableSchemasFromRegister added in v1.3.0

func GetAvailableSchemasFromRegister(httpClient *http.Client) ([]LauncherSchema, error)

GetAvailableSchemasFromRegister Gets published questionnaires from register

func LauncherSchemaFromFilename

func LauncherSchemaFromFilename(filename string) LauncherSchema

LauncherSchemaFromFilename creates a LauncherSchema record from a schema filename

type LauncherSchemas

type LauncherSchemas struct {
	Business []LauncherSchema
	Census   []LauncherSchema
	Social   []LauncherSchema
	Test     []LauncherSchema
	Register []LauncherSchema
	Other    []LauncherSchema
}

LauncherSchemas is a separation of Test and Live schemas

func GetAvailableSchemas

func GetAvailableSchemas() LauncherSchemas

GetAvailableSchemas Gets the list of static schemas an joins them with any schemas from the eq-survey-register if defined

type RegisterResponse

type RegisterResponse struct {
	FormType      string `json:"form_type"`
	LastPublished string `json:"lastPublished"`
	RegistryID    string `json:"registry_id"`
	EqID          string `json:"eq_id"`
	SurveyID      string `json:"survey_id"`
	SurveyVersion string `json:"survey_version"`
	Title         string `json:"title"`
}

RegisterResponse is the response from the eq-survey-register request

type ReqVersionBodyParams added in v1.3.0

type ReqVersionBodyParams struct {
	SurveyID      string
	FormType      string
	SurveyVersion string
}

ReqVersionBodyParams is a representation of the body params for the request

type Schema

type Schema struct {
	jsonhal.Hal
	Name string `json:"name"`
}

Schema is an available schema

type Schemas

type Schemas []Schema

Schemas is a list of Schema

Jump to

Keyboard shortcuts

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