grimoirelab

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitbucketMetadataFactory

type BitbucketMetadataFactory func(repo bitbucket.Repository) Metadata

BitbucketMetadataFactory allows to provide a custom generated metadata

type GithubMetadataFactory

type GithubMetadataFactory func(repo github.Repository) Metadata

GithubMetadataFactory allows to provide a custom generated metadata

type GithubProjectMatcher

type GithubProjectMatcher struct {
	Rules map[string]GithubProjectMatcherRule `json:"rules,omitempty"`
}

GithubProjectMatcher matches a repository with a project

func NewGithubProjectMatcherFromJSON

func NewGithubProjectMatcherFromJSON(data io.Reader) (*GithubProjectMatcher, error)

NewGithubProjectMatcherFromJSON initializes GithubProjectMatcher from json

type GithubProjectMatcherRule

type GithubProjectMatcherRule struct {
	URL *Regexp `json:"url,omitempty"`
}

GithubProjectMatcherRule rule that matches a repository to a project

type Metadata

type Metadata map[string]string

Metadata hold metadata for a given project

type Project

type Project struct {
	Metadata   Metadata `json:"meta,omitempty"`
	Git        []string `json:"git,omitempty"`
	Github     []string `json:"github,omitempty"`
	GithubRepo []string `json:"github:repo,omitempty"`
}

Project holds the project resources and metadata

type Projects

type Projects map[string]*Project

Projects holds all projects to be loaded in Grimoirelab

func ConvertBitbucketToProjectsJSON

func ConvertBitbucketToProjectsJSON(repos []bitbucket.Repository, metadataFactory BitbucketMetadataFactory) Projects

ConvertBitbucketToProjectsJSON converts the repositories into grimoirelab projects.json

func ConvertGithubToProjectsJSON

func ConvertGithubToProjectsJSON(repos []github.Repository, metadataFactory GithubMetadataFactory, projectMatcher *GithubProjectMatcher) Projects

ConvertGithubToProjectsJSON converts the repositories into grimoirelab projects.json

type Regexp

type Regexp struct {
	regexp.Regexp
}

Regexp embeds a regexp.Regexp, and adds Text/JSON (un)marshaling.

func Compile

func Compile(expr string) (*Regexp, error)

Compile wraps the result of the standard library's regexp.Compile, for easy (un)marshaling.

func MustCompile

func MustCompile(expr string) *Regexp

MustCompile wraps the result of the standard library's regexp.Compile, for easy (un)marshaling.

func (*Regexp) MarshalText

func (r *Regexp) MarshalText() ([]byte, error)

MarshalText satisfies the encoding.TextMarshaler interface, also used by json.Marshal.

func (*Regexp) UnmarshalText

func (r *Regexp) UnmarshalText(b []byte) error

UnmarshalText satisfies the encoding.TextMarshaler interface, also used by json.Unmarshal.

Jump to

Keyboard shortcuts

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