Documentation ¶
Index ¶
- Variables
- type Config
- type GitRepository
- type GithubRepositoryImpl
- func (r GithubRepositoryImpl) CreateLabel(ctx context.Context, user, repo, name string, label LabelConfig) error
- func (r GithubRepositoryImpl) DeleteLabel(ctx context.Context, user, repo, name string) error
- func (r GithubRepositoryImpl) EditLabel(ctx context.Context, user, repo, currentName, name string, label LabelConfig) error
- func (r GithubRepositoryImpl) ListLabels(ctx context.Context, user, repo string) ([]string, error)
- func (r GithubRepositoryImpl) ListORGRepos(ctx context.Context, org string) ([]*github.Repository, error)
- func (r GithubRepositoryImpl) ListOwnerRepos(ctx context.Context, owner string) ([]*github.Repository, error)
- type LabelConfig
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEmptyUser = errors.New("at least one should be present: org or owner")
)
gitlabels errors
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Owner string `yaml:"owner"` ORG string `yaml:"org"` Labels map[string]LabelConfig `yaml:"labels"` ProjectRegex string `yaml:"project-regex"` RenameLabels map[string]string `yaml:"rename"` RemoveLabels []string `yaml:"remove"` }
Config gitlabels config
func ParseConfig ¶
ParseConfig parse config from []byte
type GitRepository ¶
type GitRepository interface { ListOwnerRepos(ctx context.Context, owner string) ([]*github.Repository, error) ListORGRepos(ctx context.Context, org string) ([]*github.Repository, error) ListLabels(ctx context.Context, user, repo string) ([]string, error) CreateLabel(ctx context.Context, user, repo, name string, label LabelConfig) error EditLabel(ctx context.Context, user, repo, currentName, name string, label LabelConfig) error DeleteLabel(ctx context.Context, user, repo, name string) error }
GitRepository repository for git api
type GithubRepositoryImpl ¶
type GithubRepositoryImpl struct {
// contains filtered or unexported fields
}
GithubRepositoryImpl repository for github api
func NewGithubRepository ¶
func NewGithubRepository(token string) *GithubRepositoryImpl
NewGithubRepository GithubRepository constructor
func (GithubRepositoryImpl) CreateLabel ¶
func (r GithubRepositoryImpl) CreateLabel(ctx context.Context, user, repo, name string, label LabelConfig) error
CreateLabel create label on 'user/repository'
func (GithubRepositoryImpl) DeleteLabel ¶
func (r GithubRepositoryImpl) DeleteLabel(ctx context.Context, user, repo, name string) error
DeleteLabel delete label from 'user/repository'
func (GithubRepositoryImpl) EditLabel ¶
func (r GithubRepositoryImpl) EditLabel(ctx context.Context, user, repo, currentName, name string, label LabelConfig) error
EditLabel edit label from 'user/repository'
func (GithubRepositoryImpl) ListLabels ¶
ListLabels list all labels from 'user/repository'
func (GithubRepositoryImpl) ListORGRepos ¶
func (r GithubRepositoryImpl) ListORGRepos(ctx context.Context, org string) ([]*github.Repository, error)
ListORGRepos list all repositories from organization
func (GithubRepositoryImpl) ListOwnerRepos ¶
func (r GithubRepositoryImpl) ListOwnerRepos(ctx context.Context, owner string) ([]*github.Repository, error)
ListOwnerRepos list all repositories from owner
type LabelConfig ¶
LabelConfig config for label
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service rules for gitlabel
func NewService ¶
func NewService(git GitRepository, logger *log.Logger) *Service
NewService service constructor
Click to show internal directories.
Click to hide internal directories.