comment

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Command represents this folder's command

Functions

func GetPullRequestCommentIDs

func GetPullRequestCommentIDs(context context.Context, cmd *cobra.Command, args []string, toComplete string) (ids []string, err error)

GetPullRequestCommentIDs gets the IDs of the comments for a pullrequest

Types

type Comment

type Comment struct {
	Type        string                `json:"type"                 mapstructure:"type"`
	ID          int                   `json:"id"                   mapstructure:"id"`
	Content     common.RenderedText   `json:"content"              mapstructure:"content"`
	User        user.User             `json:"user"                 mapstructure:"user"`
	Anchor      *common.FileAnchor    `json:"inline,omitempty"     mapstructure:"inline"`
	Parent      *Comment              `json:"parent,omitempty"     mapstructure:"parent"`
	CreatedOn   time.Time             `json:"created_on"           mapstructure:"created_on"`
	UpdatedOn   time.Time             `json:"updated_on"           mapstructure:"updated_on"`
	IsDeleted   bool                  `json:"deleted"              mapstructure:"deleted"`
	IsPending   bool                  `json:"pending"              mapstructure:"pending"`
	Resolution  *Resolution           `json:"resolution,omitempty" mapstructure:"resolution"`
	PullRequest *PullRequestReference `json:"pullrequest"          mapstructure:"pullrequest"`
	Links       common.Links          `json:"links"                mapstructure:"links"`
}

func (Comment) GetHeaders

func (comment Comment) GetHeaders(cmd *cobra.Command) []string

GetHeaders gets the header for a table

implements common.Tableable

func (Comment) GetRow

func (comment Comment) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

func (Comment) MarshalJSON

func (comment Comment) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

func (Comment) String

func (comment Comment) String() string

String gets a string representation of this pullrequest

implements fmt.Stringer

func (*Comment) Validate

func (comment *Comment) Validate() error

Validate validates a Comment

type CommentCreator

type CommentCreator struct {
	Content ContentCreator     `json:"content" mapstructure:"content"`
	Anchor  *common.FileAnchor `json:"inline,omitempty" mapstructure:"inline"`
	Parent  *ParentReference   `json:"parent,omitempty" mapstructure:"parent"`
}

type CommentUpdator

type CommentUpdator struct {
	Content ContentUpdator     `json:"content" mapstructure:"content"`
	Anchor  *common.FileAnchor `json:"inline,omitempty" mapstructure:"inline"`
	Parent  *ParentReference   `json:"parent,omitempty" mapstructure:"parent"`
}

type Comments

type Comments []Comment

func (Comments) GetHeaders

func (comments Comments) GetHeaders(cmd *cobra.Command) []string

GetHeaders gets the headers for the list command

implements common.Tableables

func (Comments) GetRowAt

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

GetRowAt gets the row for the list command

implements common.Tableables

func (Comments) Size

func (comments Comments) Size() int

Size gets the number of elements

implements common.Tableables

type ContentCreator

type ContentCreator struct {
	Raw string `json:"raw" mapstructure:"raw"`
}

type ContentUpdator

type ContentUpdator struct {
	Raw string `json:"raw" mapstructure:"raw"`
}

type ParentReference

type ParentReference struct {
	ID int64 `json:"id" mapstructure:"id"`
}

type PullRequestReference

type PullRequestReference struct {
	Type  string       `json:"type"  mapstructure:"type"`
	ID    int          `json:"id"    mapstructure:"id"`
	Title string       `json:"title" mapstructure:"title"`
	Links common.Links `json:"links" mapstructure:"links"`
}

type Resolution

type Resolution struct {
	Type      string    `json:"type"       mapstructure:"type"`
	User      user.User `json:"user"       mapstructure:"user"`
	CreatedOn time.Time `json:"created_on" mapstructure:"created_on"`
}

func (Resolution) MarshalJSON

func (resolution Resolution) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

Jump to

Keyboard shortcuts

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