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 ¶
Types ¶
type CreateRequest ¶
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
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 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 ¶
func Search(client client.Client, cfg *SearchRequest) (*SearchResponse, error)
Click to show internal directories.
Click to hide internal directories.