app

package
v0.0.0-...-2c45175 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package app contains the application logic for the GitLab token expiration tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertGroupAccessTokenToDTOToken

func ConvertGroupAccessTokenToDTOToken(groupAccessToken *gitlab.GroupAccessToken) dto.Token

ConvertGroupAccessTokenToDTOToken converts a GitLab group access token to a DTO token.

func ConvertGroupAccessTokenToDTOTokens

func ConvertGroupAccessTokenToDTOTokens(groupAccessTokens []*gitlab.GroupAccessToken) []dto.Token

ConvertGroupAccessTokenToDTOTokens converts multiple GitLab group access tokens to DTO tokens.

func ConvertGroupDeployTokenToDTOToken

func ConvertGroupDeployTokenToDTOToken(groupDeployToken *gitlab.DeployToken) dto.Token

ConvertGroupDeployTokenToDTOToken converts a GitLab group deploy token to a DTO token.

func ConvertGroupDeployTokenToDTOTokens

func ConvertGroupDeployTokenToDTOTokens(groupDeployTokens []*gitlab.DeployToken) []dto.Token

ConvertGroupDeployTokenToDTOTokens converts multiple GitLab group deploy tokens to DTO tokens.

func ConvertPersonalGitlabTokenToDTOToken

func ConvertPersonalGitlabTokenToDTOToken(personalGitlabToken *gitlab.PersonalAccessToken) dto.Token

ConvertPersonalGitlabTokenToDTOToken converts a GitLab personal access token to a DTO token.

func ConvertPersonalGitlabTokenToDTOTokens

func ConvertPersonalGitlabTokenToDTOTokens(personalGitlabTokens []*gitlab.PersonalAccessToken) []dto.Token

ConvertPersonalGitlabTokenToDTOTokens converts multiple GitLab personal access tokens to DTO tokens.

func ConvertProjectAccessTokenToDTOToken

func ConvertProjectAccessTokenToDTOToken(projectAccessToken *gitlab.ProjectAccessToken) dto.Token

ConvertProjectAccessTokenToDTOToken converts a GitLab project access token to a DTO token.

func ConvertProjectAccessTokenToDTOTokens

func ConvertProjectAccessTokenToDTOTokens(projectAccessTokens []*gitlab.ProjectAccessToken) []dto.Token

ConvertProjectAccessTokenToDTOTokens converts multiple GitLab project access tokens to DTO tokens.

func ConvertProjectDeployTokenToDTOToken

func ConvertProjectDeployTokenToDTOToken(projectDeployToken *gitlab.DeployToken) dto.Token

ConvertProjectDeployTokenToDTOToken converts a GitLab project deploy token to a DTO token.

func ConvertProjectDeployTokenToDTOTokens

func ConvertProjectDeployTokenToDTOTokens(projectDeployTokens []*gitlab.DeployToken) []dto.Token

ConvertProjectDeployTokenToDTOTokens converts multiple GitLab project deploy tokens to DTO tokens.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App represents the application with GitLab client and configuration.

func NewApp

func NewApp(v views.Renderer, opts ...Option) *App

NewApp returns a new App struct.

func (*App) GetGroup

func (a *App) GetGroup(groupID int64) (*gitlab.Group, error)

GetGroup returns the group that matches the given ID.

func (*App) GetPersonalAccessTokens

func (a *App) GetPersonalAccessTokens(_ context.Context) ([]dto.Token, error)

GetPersonalAccessTokens returns the personal access tokens.

func (*App) GetProject

func (a *App) GetProject(projectID int64) (*gitlab.Project, error)

GetProject returns the project that matches the given ID.

func (*App) GetRecursiveProjectsOfGroup

func (a *App) GetRecursiveProjectsOfGroup(groupID int64) ([]*gitlab.Project, error)

GetRecursiveProjectsOfGroup returns the projects of the group that matches the given ID.

func (*App) GetSubGroups

func (a *App) GetSubGroups(groupID int64) ([]*gitlab.Group, error)

GetSubGroups returns the subgroups of the group that matches the given ID.

func (*App) GetTokensOfGroups

func (a *App) GetTokensOfGroups(_ context.Context, groups []*gitlab.Group) ([]dto.Token, error)

GetTokensOfGroups returns the tokens of all groups.

func (*App) GetTokensOfProjects

func (a *App) GetTokensOfProjects(_ context.Context, projects []*gitlab.Project) ([]dto.Token, error)

GetTokensOfProjects returns the tokens of multiple projects.

func (*App) SetGitlabEndpoint

func (a *App) SetGitlabEndpoint(gitlabAPIEndpoint string)

SetGitlabEndpoint sets the gitlab endpoint.

func (*App) SetHTTPClient

func (a *App) SetHTTPClient(httpClient *http.Client)

SetHTTPClient sets the http client.

func (*App) SetLogger

func (a *App) SetLogger(l logger.Logger)

SetLogger sets the logger.

func (*App) SetToken

func (a *App) SetToken(token string)

SetToken sets the gitlab token.

type Option

type Option func(*App)

Option is a function that configures the App.

func WithGitlabEndpoint

func WithGitlabEndpoint(gitlabAPIEndpoint string) Option

WithGitlabEndpoint sets the gitlab endpoint.

func WithRevokedToken

func WithRevokedToken(printRevoked bool) Option

WithRevokedToken sets the printRevoked flag.

Jump to

Keyboard shortcuts

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