mturk

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFlags

func ConfigFlags(cmd *cobra.Command, prefix string) error

ConfigFlags helps configure cobra and viper flags.

Types

type Config

type Config struct {
	Dev bool `mapstructure:"dev"`
}

Config is MTurk configuration

func (*Config) Validate

func (c *Config) Validate() error

Validate configuration is ok

type Session

type Session struct {
	*mturk.MTurk
	// contains filtered or unexported fields
}

Session keep the mTurk session state.

func New

func New(config *Config, sandbox bool, rootURL string, store *storage.Conn) (*Session, error)

New create a new session for mTurk

func (*Session) EndStep

func (s *Session) EndStep(project *ent.Project, run *ent.Run, step *ent.Step, stepRun *ent.StepRun, nextStep *ent.Step, nextStepRun *ent.StepRun) error

EndStep to end step based on stepType

func (*Session) GetLocales

func (s *Session) GetLocales() ([]*model.MTurkLocale, error)

GetLocales will get JSON Locales

func (*Session) GetQuals

func (s *Session) GetQuals() ([]*model.MTurkQulificationType, error)

GetQuals will get a list of qualification types created by the user

func (*Session) StartStep

func (s *Session) StartStep(project *ent.Project, run *ent.Run, step *ent.Step, stepRun *ent.StepRun, startTime time.Time) error

StartStep to run step based on stepType

Jump to

Keyboard shortcuts

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