repository

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Command represents this folder's command

Functions

func GetRepositorySlugs added in v0.7.0

func GetRepositorySlugs(context context.Context, cmd *cobra.Command, workspace string) (slugs []string)

GetRepositorySlugs gets the slugs of all repositories

Types

type Repositories added in v0.7.0

type Repositories []Repository

func (Repositories) GetHeader added in v0.7.0

func (repositories Repositories) GetHeader() []string

GetHeader gets the header for a table

implements common.Tableables

func (Repositories) GetRowAt added in v0.7.0

func (repositories Repositories) GetRowAt(index int, headers []string) []string

GetRowAt gets the row for a table

implements common.Tableables

func (Repositories) Size added in v0.7.0

func (repositories Repositories) Size() int

Size gets the number of elements

implements common.Tableables

type Repository

type Repository struct {
	Type                 string              `json:"type"               mapstructure:"type"`
	ID                   common.UUID         `json:"uuid"               mapstructure:"uuid"`
	Name                 string              `json:"name"               mapstructure:"name"`
	FullName             string              `json:"full_name"          mapstructure:"full_name"`
	Slug                 string              `json:"slug"               mapstructure:"slug"`
	Owner                user.Account        `json:"owner"              mapstructure:"owner"`
	Workspace            workspace.Workspace `json:"workspace"          mapstructure:"workspace"`
	Project              project.Project     `json:"project"            mapstructure:"project"`
	HasIssues            bool                `json:"has_issues"         mapstructure:"has_issues"`
	HasWiki              bool                `json:"has_wiki"           mapstructure:"has_wiki"`
	IsPrivate            bool                `json:"is_private"         mapstructure:"is_private"`
	ForkPolicy           string              `json:"fork_policy"        mapstructure:"fork_policy"`
	Size                 int64               `json:"size"               mapstructure:"size"`
	Language             string              `json:"language,omitempty" mapstructure:"language"`
	MainBranch           string              `json:"-"                  mapstructure:"-"`
	DefaultMergeStrategy string              `json:"-"                  mapstructure:"-"`
	BranchingModel       string              `json:"-"                  mapstructure:"-"`
	Parent               *Repository         `json:"parent"             mapstructure:"parent"`
	Links                common.Links        `json:"links"              mapstructure:"links"`
	CreatedOn            time.Time           `json:"created_on"         mapstructure:"created_on"`
	UpdatedOn            time.Time           `json:"updated_on"         mapstructure:"updated_on"`
}

func GetRepository added in v0.5.0

func GetRepository(context context.Context, cmd *cobra.Command, profile *profile.Profile, workspace, slug string) (repository *Repository, err error)

GetRepository gets a repository by its slug

func GetRepositoryFromGit added in v0.11.0

func GetRepositoryFromGit(context context.Context, cmd *cobra.Command, profile *profile.Profile) (repository *Repository, err error)

GetRepositoryFromGit gets a repository from a git origin

func (Repository) GetHeader added in v0.7.0

func (repository Repository) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (Repository) GetRow added in v0.7.0

func (repository Repository) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

func (Repository) MarshalJSON added in v0.7.0

func (repository Repository) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

Implements json.Marshaler

func (Repository) String added in v0.5.0

func (repository Repository) String() string

String returns the string representation of the repository

implements fmt.Stringer

func (*Repository) UnmarshalJSON added in v0.7.0

func (repository *Repository) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface.

Implements json.Unmarshaler

type RepositoryCreator added in v0.7.0

type RepositoryCreator struct {
	Name        string                    `json:"name"                  mapstructure:"name"`
	Description string                    `json:"description,omitempty" mapstructure:"description"`
	Project     *project.ProjectReference `json:"project,omitempty"     mapstructure:"project"`
	IsPrivate   bool                      `json:"is_private"            mapstructure:"is_private"`
	Language    string                    `json:"language,omitempty"    mapstructure:"language"`
	MainBranch  *branch                   `json:"mainbranch,omitempty"  mapstructure:"mainbranch"`
	ForkPolicy  string                    `json:"fork_policy,omitempty" mapstructure:"fork_policy"`
}

type RepositoryForkCreator added in v0.7.0

type RepositoryForkCreator struct {
	Name        string                    `json:"name"                  mapstructure:"name"`
	Description string                    `json:"description,omitempty" mapstructure:"description"`
	Project     *project.ProjectReference `json:"project,omitempty"     mapstructure:"project"`
	IsPrivate   bool                      `json:"is_private"            mapstructure:"is_private"`
	Language    string                    `json:"language,omitempty"    mapstructure:"language"`
	MainBranch  *branch                   `json:"mainbranch,omitempty"  mapstructure:"mainbranch"`
	ForkPolicy  string                    `json:"fork_policy,omitempty" mapstructure:"fork_policy"`
}

type RepositoryUpdator added in v0.7.0

type RepositoryUpdator struct {
	Name        string                    `json:"name,omitempty"                  mapstructure:"name"`
	Description string                    `json:"description,omitempty" mapstructure:"description"`
	Project     *project.ProjectReference `json:"project,omitempty"     mapstructure:"project"`
	IsPrivate   *bool                     `json:"is_private,omitempty"            mapstructure:"is_private"`
	Language    string                    `json:"language,omitempty"    mapstructure:"language"`
	MainBranch  *branch                   `json:"mainbranch,omitempty"  mapstructure:"mainbranch"`
	ForkPolicy  string                    `json:"fork_policy,omitempty" mapstructure:"fork_policy"`
}

Jump to

Keyboard shortcuts

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