gitlab

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildListProjectsOptions

func BuildListProjectsOptions(optionsFuncs ...ListProjectOptionsFunc) *gitlab.ListProjectsOptions

func WithInternalVisibility

func WithInternalVisibility(opt *gitlab.ListProjectsOptions)

func WithPaging

func WithPaging(page, items int) gitlab.ListOptions

func WithPrivateVisibility

func WithPrivateVisibility(opt *gitlab.ListProjectsOptions)

func WithPublicVisibility

func WithPublicVisibility(opt *gitlab.ListProjectsOptions)

Types

type Client

type Client struct {
	*gitlab.Client
}

func NewClientWithTokenAuth

func NewClientWithTokenAuth(baseUrl, token string, writer io.Writer) (*Client, error)

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context, optionsFuncs ...ListProjectOptionsFunc) ([]Repository, error)

type ListProjectOptionsFunc

type ListProjectOptionsFunc func(*gitlab.ListProjectsOptions)

func ConvertFiltersToListProjectOptions

func ConvertFiltersToListProjectOptions(filter string) []ListProjectOptionsFunc

ConvertFiltersToListProjectOptions converts the filter expressions to ListProjectOptions

type Repository

type Repository struct {
	ID             int               `json:"id,omitempty"`
	Name           string            `json:"name,omitempty"`
	Description    string            `json:"description,omitempty"`
	Owner          string            `json:"owner,omitempty"`
	URL            string            `json:"url,omitempty"`
	SSHURL         string            `json:"sshurl,omitempty"`
	CreatedAt      *time.Time        `json:"created_at,omitempty"`
	LastActivityAt *time.Time        `json:"last_activity_at,omitempty"`
	Visibility     shared.Visibility `json:"visibility,omitempty"`
}

func Map

func Map(projects []*gitlab.Project) []Repository

func Reduce

func Reduce(repositories []Repository, filter string) ([]Repository, error)

Reduce filters the repositories based on the given filter

func (Repository) CreatedSince

func (r Repository) CreatedSince(date string) bool

CreatedSince indicates if a repository has been created since the given date. Date has to be given in RFC3339 format, e.g. `2006-01-02T15:04:05Z07:00`.

func (Repository) IsInternal

func (r Repository) IsInternal() bool

IsInternal indicates if a repository has internal visibility.

func (Repository) IsPrivate

func (r Repository) IsPrivate() bool

IsPrivate indicates if a repository has private visibility.

func (Repository) IsPublic

func (r Repository) IsPublic() bool

IsPublic indicates if a repository has public visibility.

func (Repository) LastActivitySince

func (r Repository) LastActivitySince(date string) bool

LastActivitySince indicates if a repository has been active since the given date. Date has to be given in RFC3339 format, e.g. `2006-01-02T15:04:05Z07:00`.

type RepositoryFilterEnv

type RepositoryFilterEnv struct {
	Repositories []Repository
}

RepositoryFilterEnv filter environment for repositories

func (RepositoryFilterEnv) Contains

func (RepositoryFilterEnv) Contains(s, substring string) bool

Contains reports wether substring is in s.

Jump to

Keyboard shortcuts

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