activity

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Command represents this folder's command

Functions

This section is empty.

Types

type Activities

type Activities []Activity

func (Activities) GetHeader

func (activities Activities) GetHeader() []string

GetHeader gets the headers for the list command

implements common.Tableables

func (Activities) GetRowAt

func (activities Activities) GetRowAt(index int, headers []string) []string

GetRowAt gets the row for the list command

implements common.Tableables

func (Activities) Size

func (activities Activities) Size() int

Size gets the number of elements

implements common.Tableables

type Activity

type Activity struct {
	PullRequest PullRequestReference `json:"pull_request" mapstructure:"pullrequest"`
	Approval    *Approval            `json:"approval,omitempty"     mapstructure:"approval"`
	Comment     *comment.Comment     `json:"comment,omitempty"      mapstructure:"comment"`
	Update      *Update              `json:"update,omitempty"       mapstructure:"update"`
}

func (Activity) GetHeader

func (activity Activity) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (Activity) GetRow

func (activity Activity) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

func (Activity) MarshalJSON

func (activity Activity) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

implements json.Marshaler

func (Activity) String

func (activity Activity) String() string

String gets a string representation of this pullrequest

implements fmt.Stringer

func (*Activity) UnmarshalJSON

func (activity *Activity) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface.

implements json.Unmarshaler

func (*Activity) Validate

func (activity *Activity) Validate() error

Validate validates a Comment

type Approval

type Approval struct {
	Date        time.Time             `json:"date"        mapstructure:"date"`
	User        user.User             `json:"user"        mapstructure:"user"`
	PullRequest *PullRequestReference `json:"pullrequest" mapstructure:"pullrequest"`
}

type Branch

type Branch struct {
	Name                 string   `json:"name"                             mapstructure:"name"`
	MergeStrategies      []string `json:"merge_strategies,omitempty"       mapstructure:"merge_strategies"`
	DefaultMergeStrategy string   `json:"default_merge_strategy,omitempty" mapstructure:"default_merge_strategy"`
}

type Endpoint

type Endpoint struct {
	Branch     Branch                 `json:"branch"               mapstructure:"branch"`
	Commit     *commit.Commit         `json:"commit,omitempty"     mapstructure:"commit"`
	Repository *repository.Repository `json:"repository,omitempty" mapstructure:"repository"`
}

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 Update

type Update struct {
	Date              time.Time           `json:"date"                   mapstructure:"date"`
	Type              string              `json:"type"                   mapstructure:"type"`
	ID                uint64              `json:"id"                     mapstructure:"id"`
	Title             string              `json:"title"                  mapstructure:"title"`
	Description       string              `json:"description"            mapstructure:"description"`
	Summary           common.RenderedText `json:"summary"                mapstructure:"summary"`
	State             string              `json:"state"                  mapstructure:"state"`
	MergeCommit       *commit.Commit      `json:"merge_commit,omitempty" mapstructure:"merge_commit"`
	CloseSourceBranch bool                `json:"close_source_branch"    mapstructure:"close_source_branch"`
	ClosedBy          user.User           `json:"closed_by"              mapstructure:"closed_by"`
	Author            user.User           `json:"author"                 mapstructure:"author"`
	Reason            string              `json:"reason"                 mapstructure:"reason"`
	Destination       Endpoint            `json:"destination"            mapstructure:"destination"`
	Source            Endpoint            `json:"source"                 mapstructure:"source"`
	Links             common.Links        `json:"links"                  mapstructure:"links"`
	CommentCount      uint64              `json:"comment_count"          mapstructure:"comment_count"`
	TaskCount         uint64              `json:"task_count"             mapstructure:"task_count"`
	CreatedOn         time.Time           `json:"created_on"             mapstructure:"created_on"`
	UpdatedOn         time.Time           `json:"updated_on"             mapstructure:"updated_on"`
}

Jump to

Keyboard shortcuts

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