config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_LAYOUT = "2006-01-02 15:04:05 JST"

Variables

View Source
var MATCH_ALL = regexp.MustCompile(".*")

Functions

This section is empty.

Types

type BitBucketClone added in v0.3.0

type BitBucketClone struct {
	Href string `json:"href"`
	Name string `json:"name"`
}
type BitBucketLink struct {
	URL string `json:"url"`
	Rel string `json:"rel"`
}
type BitBucketLinks struct {
	Clone []BitBucketClone `json:"clone"`
	Self  []BitBucketLink  `json:"self"`
}

type BitBucketProject added in v0.3.0

type BitBucketProject struct {
	Key         string        `json:"key"`
	ID          int           `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Public      bool          `json:"public"`
	Type        string        `json:"type"`
	Link        BitBucketLink `json:"link"`
	Links       struct {
		Self []struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"links"`
}

type BitBucketRepositories added in v0.3.0

type BitBucketRepositories struct {
	BitBucketResponse
	Values []BitBucketRepository `json:"values"`
}

type BitBucketRepository added in v0.3.0

type BitBucketRepository struct {
	Slug          string           `json:"slug"`
	ID            int              `json:"id"`
	Name          string           `json:"name"`
	ScmID         string           `json:"scmId"`
	State         string           `json:"state"`
	StatusMessage string           `json:"statusMessage"`
	Forkable      bool             `json:"forkable"`
	Project       BitBucketProject `json:"project"`
	Public        bool             `json:"public"`
	CloneURL      string           `json:"cloneUrl"`
	Link          BitBucketLink    `json:"link"`
	Links         BitBucketLinks   `json:"links"`
}

type BitBucketResponse added in v0.3.0

type BitBucketResponse struct {
	Size          int  `json:"size"`
	Limit         int  `json:"limit"`
	IsLastPage    bool `json:"isLastPage"`
	Start         int  `json:"start"`
	NextPageStart int  `json:"nextPageStart"`
}

type BitbucketOrganizationSetting added in v0.3.0

type BitbucketOrganizationSetting struct {
	OrganizationSetting
}

func (*BitbucketOrganizationSetting) GetRefFilters added in v0.5.0

func (b *BitbucketOrganizationSetting) GetRefFilters(project string, repository string) (*regexp.Regexp, *regexp.Regexp, *regexp.Regexp, *regexp.Regexp)

func (*BitbucketOrganizationSetting) JSON added in v0.5.0

func (b *BitbucketOrganizationSetting) JSON() ([]byte, error)

func (*BitbucketOrganizationSetting) SyncSCM added in v0.3.0

func (b *BitbucketOrganizationSetting) SyncSCM() error

type BrancheIndexedMap added in v0.4.0

type BrancheIndexedMap map[string]string

type Config

type Config struct {
	DataDir     string
	GitDataDir  string
	ConfDir     string
	IndexedDir  string
	Port        int
	IndexerType string
	Schedule    string
	Debug       bool
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(c *cli.Context, debug bool) *Config

func (*Config) AddRepositorySetting added in v0.3.0

func (c *Config) AddRepositorySetting(organization string, project string, url string, scmOptions map[string]string,
	sizeLimit int64, includeBranches, excludeBranches, includeTags, excludeTags string) error

func (*Config) AddSetting added in v0.3.0

func (c *Config) AddSetting(organization string, scmOptions map[string]string,
	sizeLimit int64, includeBranches, excludeBranches, includeTags, excludeTags string) error

func (*Config) DeleteIndexed added in v0.4.0

func (c *Config) DeleteIndexed(organization string, project string, repository string, removeBranches []string, removeTags []string) error

func (*Config) FindSetting added in v0.4.0

func (c *Config) FindSetting(organization string) (SyncSetting, bool)

func (*Config) GetIndexed added in v0.4.0

func (c *Config) GetIndexed(organization string, project string, repository string) Indexed

func (*Config) GetSettings added in v0.3.0

func (c *Config) GetSettings() []SyncSetting

func (*Config) GetSizeLimit added in v0.5.0

func (c *Config) GetSizeLimit(organization, project, repository string) int64

func (*Config) Sync added in v0.3.0

func (c *Config) Sync()

func (*Config) SyncAllSCM added in v0.3.0

func (c *Config) SyncAllSCM() error

func (*Config) SyncSCM added in v0.3.0

func (c *Config) SyncSCM(organization string) error

func (*Config) UpdateIndexed added in v0.4.0

func (c *Config) UpdateIndexed(indexed Indexed) error

type Indexed added in v0.4.0

type Indexed struct {
	LastUpdated  string            `json:"lastUpdated"`
	Organization string            `json:"organization"`
	Project      string            `json:"project"`
	Repository   string            `json:"repository"`
	Branches     BrancheIndexedMap `json:"branches"`
	Tags         TagIndexedMap     `json:"tags"`
}

type OrganizationSetting added in v0.3.0

type OrganizationSetting struct {
	Name            string            `json:"name"`
	Projects        []ProjectSetting  `json:"projects,omitempty"`
	Scm             map[string]string `json:"scm,omitempty"`
	SizeLimit       int64             `json:"sizeLimit,omitempty"`
	IncludeBranches string            `json:"includeBranches,omitempty"`
	ExcludeBranches string            `json:"excludeBranches,omitempty"`
	IncludeTags     string            `json:"includeTags,omitempty"`
	ExcludeTags     string            `json:"excludeTags,omitempty"`
}

func (*OrganizationSetting) AddRepository added in v0.3.0

func (o *OrganizationSetting) AddRepository(project string, url string) error

func (*OrganizationSetting) FindProjectSetting added in v0.3.0

func (o *OrganizationSetting) FindProjectSetting(project string) (*ProjectSetting, bool)

func (*OrganizationSetting) FindRepositorySetting added in v0.3.0

func (o *OrganizationSetting) FindRepositorySetting(project string, repository string) (*RepositorySetting, bool)

func (*OrganizationSetting) GetName added in v0.3.0

func (o *OrganizationSetting) GetName() string

func (*OrganizationSetting) GetProjects added in v0.3.0

func (o *OrganizationSetting) GetProjects() []ProjectSetting

func (*OrganizationSetting) GetRefFilters added in v0.5.0

func (o *OrganizationSetting) GetRefFilters(project string, repository string) (*regexp.Regexp, *regexp.Regexp, *regexp.Regexp, *regexp.Regexp)

func (*OrganizationSetting) GetSCM added in v0.3.0

func (o *OrganizationSetting) GetSCM() map[string]string

func (*OrganizationSetting) GetSizeLimit added in v0.5.0

func (o *OrganizationSetting) GetSizeLimit() int64

func (*OrganizationSetting) JSON added in v0.3.0

func (o *OrganizationSetting) JSON() ([]byte, error)

func (*OrganizationSetting) SyncSCM added in v0.3.0

func (o *OrganizationSetting) SyncSCM() error

type ProjectSetting added in v0.3.0

type ProjectSetting struct {
	Name            string              `json:"name"`
	Repositories    []RepositorySetting `json:"repositories"`
	SizeLimit       int64               `json:"sizeLimit,omitempty"`
	IncludeBranches string              `json:"includeBranches,omitempty"`
	ExcludeBranches string              `json:"excludeBranches,omitempty"`
	IncludeTags     string              `json:"includeTags,omitempty"`
	ExcludeTags     string              `json:"excludeTags,omitempty"`
}

type RepositorySetting added in v0.3.0

type RepositorySetting struct {
	Url string `json:"url"`

	SizeLimit       int64  `json:"sizeLimit,omitempty"`
	IncludeBranches string `json:"includeBranches,omitempty"`
	ExcludeBranches string `json:"excludeBranches,omitempty"`
	IncludeTags     string `json:"includeTags,omitempty"`
	ExcludeTags     string `json:"excludeTags,omitempty"`
	// contains filtered or unexported fields
}

func (*RepositorySetting) GetName added in v0.3.0

func (r *RepositorySetting) GetName() string

type SyncSetting added in v0.3.0

type SyncSetting interface {
	GetName() string
	GetProjects() []ProjectSetting
	GetSCM() map[string]string
	SyncSCM() error
	AddRepository(project string, repositoryUrl string) error
	FindProjectSetting(project string) (*ProjectSetting, bool)
	FindRepositorySetting(project string, repository string) (*RepositorySetting, bool)
	JSON() ([]byte, error)
	GetRefFilters(project string, repository string) (*regexp.Regexp, *regexp.Regexp, *regexp.Regexp, *regexp.Regexp)
	GetSizeLimit() int64
}

func NewBitbucketOrganizationSetting added in v0.3.0

func NewBitbucketOrganizationSetting(o OrganizationSetting) SyncSetting

type TagIndexedMap added in v0.4.0

type TagIndexedMap map[string]string

Jump to

Keyboard shortcuts

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