repository

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateConfig = &request.Config{
	Action:   "POST",
	Resource: "projects",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var DeleteConfig = &request.Config{
	Action:   "DELETE",
	Resource: "projects/:project_id",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var GetConfig = &request.Config{
	Action:   "GET",
	Resource: "projects/:project_id",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var ListConfig = &request.Config{
	Action:   "GET",
	Resource: "groups/:group_id/projects",
}
View Source
var SearchConfig = &request.Config{
	Action:   "GET",
	Resource: "search",
}

Functions

func Delete

func Delete(client client.Client, name string) error

Types

type CreateRequest

type CreateRequest struct {
	// NamespaceID          string `json:"namespace_id"`
	Name                 string `json:"name"`
	Description          string `json:"description"`
	InitializeWithREADME bool   `json:"initialize_with_readme"`
	DefaultBranch        string `json:"default_branch"`
}

type CreateResponse

type CreateResponse = Repository

func Create

func Create(client client.Client, req *CreateRequest) (*CreateResponse, error)

type DeleteResponse

type DeleteResponse struct {
	Repository
}

type GetResponse

type GetResponse = Repository

func Get

func Get(client client.Client, name string) (*GetResponse, error)

type ListRequest

type ListRequest struct {
	GroupID int64 `json:"group_id"`
}

type ListResponse

type ListResponse = []Repository

func List

func List(client client.Client, cfg *ListRequest) (*ListResponse, error)

type Namespace

type Namespace struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Path string `json:"path"`
	Kind string `json:"kind"` // group, user
	// FullPath  string `json:"full_path"`
	ParentID  int64  `json:"parent_id"`
	AvatarURL string `json:"avatar_url"`
	WebURL    string `json:"web_url"`
}

type Repository

type Repository struct {

	//
	ID            int64     `json:"id"`
	Name          string    `json:"name"`
	Path          string    `json:"path_with_namespace"`
	Description   string    `json:"description"`
	CreatedAt     time.Time `json:"created_at"`
	DefaultBranch string    `json:"default_branch"`
	SSHURL        string    `json:"ssh_url_to_repo"`
	HTTPURL       string    `json:"http_url_to_repo"`
	WebURL        string    `json:"web_url"`
	READMEURL     string    `json:"readme_url"`
	//
	LastActivityAt time.Time `json:"last_activity_at"`
	Visibility     string    `json:"visibility"` // internal, public, internal_only
	//
	Namespace Namespace `json:"namespace"`
	// contains filtered or unexported fields
}

func (*Repository) Create

func (r *Repository) Create(req *CreateRequest) (*Repository, error)

func (*Repository) Delete

func (r *Repository) Delete(name string) error

func (*Repository) Get

func (r *Repository) Get(name string) (*Repository, error)

func (*Repository) List

func (r *Repository) List(cfg *ListRequest) (*[]Repository, error)

type RepositoryImpl

type RepositoryImpl interface {
	List(cfg *ListRequest) (*[]Repository, error)
	Create(req *CreateRequest) (*Repository, error)
	Get(name string) (*Repository, error)
	Delete(name string) error
}

func New

func New(client client.Client) RepositoryImpl

type SearchRequest

type SearchRequest struct {
	// [REQUIRED] Search Keyword
	Keyword string `json:"keyword"`
}

type SearchResponse

type SearchResponse = []Repository
func Search(client client.Client, cfg *SearchRequest) (*SearchResponse, error)

Jump to

Keyboard shortcuts

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