attachment

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:   "attachment",
	Short: "Manage attachments",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Attachment requires a subcommand:")
		for _, command := range cmd.Commands() {
			fmt.Println(command.Name())
		}
	},
}

Command represents this folder's command.

Functions

func GetAttachmentNames

func GetAttachmentNames(context context.Context, cmd *cobra.Command, currentProfile *profile.Profile, issueID string) (names []string)

GetAttachmentNames gets the names of the attachments

func GetIssueIDs

func GetIssueIDs(context context.Context, cmd *cobra.Command, args []string) (ids []string)

GetIssueIDs gets the IDs of the issues

Types

type Attachment

type Attachment struct {
	Type string         `json:"type"  mapstructure:"type"`
	Name string         `json:"name"  mapstructure:"name"`
	Link AttachmentLink `json:"links" mapstructure:"links"`
}

func (Attachment) GetHeader

func (attachment Attachment) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (Attachment) GetRow

func (attachment Attachment) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

func (Attachment) String

func (attachment Attachment) String() string

String gets a string representation of this pullrequest

implements fmt.Stringer

func (*Attachment) Validate

func (attachment *Attachment) Validate() error

Validate validates a Comment

type AttachmentLink url.URL

func (AttachmentLink) MarshalJSON

func (link AttachmentLink) MarshalJSON() (data []byte, err error)

MarshalJSON marshals the URL into JSON

implements the json.Marshaler interface

func (AttachmentLink) String

func (link AttachmentLink) String() string

String returns the string representation of the URL

implements the Stringer interface

func (*AttachmentLink) UnmarshalJSON

func (link *AttachmentLink) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the URL from JSON

implements the json.Unmarshaler interface

type Attachments

type Attachments []Attachment

func (Attachments) GetHeader

func (comments Attachments) GetHeader() []string

GetHeader gets the headers for the list command

implements common.Tableables

func (Attachments) GetRowAt

func (comments Attachments) GetRowAt(index int, headers []string) []string

GetRowAt gets the row for the list command

implements common.Tableables

func (Attachments) Size

func (comments Attachments) Size() int

Size gets the number of elements

implements common.Tableables

Jump to

Keyboard shortcuts

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