Documentation
¶
Index ¶
- Constants
- func NewCollectionCommand(client client.API, w io.Writer) *cobra.Command
- func NewCreateCollectionCommand(c client.API, w io.Writer) *cobra.Command
- func NewGetCommand(c client.API, w io.Writer) *cobra.Command
- func NewListCommand(c client.API, w io.Writer) *cobra.Command
- func NewPreviewCommand(c client.API, w io.Writer) *cobra.Command
- func NewPreviewCommandWithOpener(c client.API, w io.Writer, browserOpener BrowserOpener) *cobra.Command
- func NewPublishCommand(c client.API, w io.Writer) *cobra.Command
- func NewUpdateCommand(client client.API, w io.Writer) *cobra.Command
- type BrowserOpener
- type CreateCollectionOptions
- type GetOptions
- type ListOptions
- type PreviewOptions
- type PublishOptions
- type UpdateOptions
Constants ¶
const ( // Error messages ErrCollectionItemsRequired = "at least one collection item must be provided" ErrPageItemsRequired = "each page must have at least one item in page_items" ErrWorkspaceIDRequired = "workspace ID is required" ErrNameRequired = "name is required" ErrWorkspaceNotFound = "workspace not found" ErrTaskDetailsRequired = "task_details is required" ErrTaskNameRequired = "task_details.task_name is required" ErrTaskIntroductionRequired = "task_details.task_introduction is required" ErrTaskStepsRequired = "task_details.task_steps is required" // Feature access constants for AI Task Builder Collections (see DCP-2152) FeatureNameAITBCollection = "AI Task Builder Collections" FeatureContactURLAITBCollection = "https://researcher-help.prolific.com/en/" )
Variables ¶
This section is empty.
Functions ¶
func NewCollectionCommand ¶
NewCollectionCommand creates a new `collection` command
func NewCreateCollectionCommand ¶
NewCreateCollectionCommand creates a new `collection create` command to allow you to create a collection.
func NewGetCommand ¶
NewGetCommand creates a new `collection get` command to retrieve details about a specific collection.
func NewListCommand ¶
NewListCommand creates a new `collection list` command to give you details about your collections.
func NewPreviewCommand ¶
NewPreviewCommand creates a new `collection preview` command to open a collection preview in the browser.
func NewPreviewCommandWithOpener ¶
func NewPreviewCommandWithOpener(c client.API, w io.Writer, browserOpener BrowserOpener) *cobra.Command
NewPreviewCommandWithOpener creates a new `collection preview` command with a custom browser opener. This is useful for testing to avoid opening actual browser windows.
func NewPublishCommand ¶
NewPublishCommand creates a new `collection publish` command to publish a collection as a study.
Types ¶
type BrowserOpener ¶
BrowserOpener is a function type for opening URLs in a browser. This allows for dependency injection in tests.
var DefaultBrowserOpener BrowserOpener = browser.OpenURL
DefaultBrowserOpener uses the system browser to open URLs.
type CreateCollectionOptions ¶
CreateCollectionOptions is the options for creating a collection command.
type GetOptions ¶
type GetOptions struct {
Args []string
}
GetOptions is the options for the get collection command.
type ListOptions ¶
type ListOptions struct {
Args []string
Csv bool
Json bool
Fields string
NonInteractive bool
WorkspaceID string
Limit int
Offset int
}
ListOptions is the options for the listing collections command.
type PreviewOptions ¶
type PreviewOptions struct {
Args []string
BrowserOpener BrowserOpener
}
PreviewOptions is the options for the preview collection command.
type PublishOptions ¶
type PublishOptions struct {
Args []string
Participants int
Name string
Description string
TemplatePath string
Draft bool
}
PublishOptions is the options for the publish collection command.
type UpdateOptions ¶
type UpdateOptions struct {
TemplatePath string
}