comment

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 13 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 GetIssueCommentIDs

func GetIssueCommentIDs(context context.Context, cmd *cobra.Command, currentProfile *profile.Profile, issueID string) (ids []string, err error)

GetIssueCommentIDs gets the IDs of the issues

func GetIssueIDs

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

GetIssueIDs gets the IDs of the issues

Types

type Comment

type Comment struct {
	ID        int                 `json:"id"               mapstructure:"id"`
	Content   common.RenderedText `json:"content"          mapstructure:"content"`
	User      user.Account        `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"`
	Links     common.Links        `json:"links"            mapstructure:"links"`
}

func (Comment) GetHeader

func (comment Comment) GetHeader(short bool) []string

GetHeader 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 added in v0.6.0

type CommentCreator struct {
	Content common.RenderedText `json:"content" mapstructure:"content"`
}

type CommentUpdator added in v0.6.0

type CommentUpdator struct {
	Content common.RenderedText `json:"content" mapstructure:"content"`
}

type Comments

type Comments []Comment

func (Comments) GetHeader

func (comments Comments) GetHeader() []string

GetHeader 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

Jump to

Keyboard shortcuts

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