gitlab

package
v0.0.0-...-0049866 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api interface {
	Search(term string) ([]Project, error)
	GetProjectVars(project string) (CiVariableList, error)
	CreateVar(project string, variable CiVariable) (*CiVariable, error)
	UpdateVar(project string, variable CiVariable) (*CiVariable, error)
}

Api provides necessary methods to interact with the Gitlab's REST API. Docs: https://docs.gitlab.com/ee/api/api_resources.html

func New

func New(gitlabUrl string, token string, httpClient *http.Client) Api

type CiVariable

type CiVariable struct {
	Key              string `json:"key"`
	VariableType     string `json:"variable_type"`
	Value            string `json:"value"`
	Protected        bool   `json:"protected"`
	Masked           bool   `json:"masked"`
	EnvironmentScope string `json:"environment_scope"`
}

type CiVariableList

type CiVariableList []CiVariable

func (*CiVariableList) Includes

func (c *CiVariableList) Includes(needle CiVariable) bool

func (*CiVariableList) Push

func (c *CiVariableList) Push(newElement ...CiVariable)

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Message string `json:"message"`
}

type Filter

type Filter struct {
	EnvironmentScope string `url:"environment_scope"`
}

type Project

type Project struct {
	PathWithNamespace string `json:"path_with_namespace"`
	WebUrl            string `json:"web_url"`
}

type Query

type Query struct {
	// Page number (default: 1).
	Page int `url:"page,omitempty"`
	// Number of items to list per page (default: 20, max: 100).
	PerPage int `url:"per_page,omitempty"`
}

type UpdateBody

type UpdateBody struct {
	Value  string `url:"value"`
	Filter Filter `url:"filter"`
}

Jump to

Keyboard shortcuts

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