Documentation
¶
Index ¶
Constants ¶
const ( // MarkdownType a Markdown text that is displayed in the form to provide extra context to the user, // https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#markdown MarkdownType = "markdown" // TextareaType multi-line text field. // https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#textarea TextareaType = "textarea" // InputType a single-line text field. // https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#input InputType = "input" // DropdownType a dropdown menu. // https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#dropdown DropdownType = "dropdown" // CheckboxType a set of checkboxes. // https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#checkboxes CheckboxType = "checkbox" // UploadType a file upload field. // https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#upload UploadType = "upload" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes struct {
Label string `yaml:"label,omitempty"`
Description string `yaml:"description,omitempty"`
Placeholder string `yaml:"placeholder,omitempty"`
Value string `yaml:"value,omitempty"`
Render string `yaml:"render,omitempty"`
Multiple bool `yaml:"multiple,omitempty"`
Options []CheckboxOrString `yaml:"options,omitempty"`
Default int `yaml:"default,omitempty"`
}
Attributes holds element attributes. https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
type CheckboxOrString ¶
CheckboxOrString carries:
- either a plain string (dropdown option)
- or a checkbox option object (label + required).
func (*CheckboxOrString) UnmarshalYAML ¶
func (o *CheckboxOrString) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML supports both shapes for option entries:
- dropdown style: "Some option"
- checkbox style: { label: "...", required: ... }
type Element ¶
type Element struct {
Type string `yaml:"type"`
ID string `yaml:"id,omitempty"`
Attributes Attributes `yaml:"attributes,omitempty"`
Validations Validations `yaml:"validations,omitempty"`
}
Element represents a single body element of any kind. https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
type Form ¶
type Form struct {
Slug string `yaml:"-"`
Filename string `yaml:"-"`
Name string `yaml:"name"`
Description string `yaml:"description"`
Body []*Element `yaml:"body"`
Assignees StringOrSlice `yaml:"assignees,omitempty"`
Labels StringOrSlice `yaml:"labels,omitempty"`
Title string `yaml:"title,omitempty"`
Type string `yaml:"type,omitempty"`
Projects StringOrSlice `yaml:"projects,omitempty"`
}
Form represents a GitHub issue form definition. https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
type SchemaValidator ¶
type SchemaValidator struct {
// contains filtered or unexported fields
}
func NewSchemaChooserValidator ¶
func NewSchemaChooserValidator() (*SchemaValidator, error)
func NewSchemaDiscussionValidator ¶
func NewSchemaDiscussionValidator() (*SchemaValidator, error)
func NewSchemaIssueValidator ¶
func NewSchemaIssueValidator() (*SchemaValidator, error)
type StringOrSlice ¶
type StringOrSlice []string
StringOrSlice array or comma-delimited string.
func (*StringOrSlice) UnmarshalYAML ¶
func (s *StringOrSlice) UnmarshalYAML(value *yaml.Node) error
type Validations ¶
type Validations struct {
Required bool `yaml:"required,omitempty"`
Accept string `yaml:"accept,omitempty"`
}
Validations holds element validation rules. https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema