org

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Metadata
	Teams   map[string]Team `json:"teams,omitempty"`
	Members []string        `json:"members,omitempty"`
	Admins  []string        `json:"admins,omitempty"`
	Repos   map[string]Repo `json:"repos,omitempty"`
}

Config declares org metadata as well as its people and teams.

type FullConfig

type FullConfig struct {
	Orgs map[string]Config `json:"orgs,omitempty"`
}

FullConfig stores the full configuration to be used by the tool, mapping orgs to their configuration at the top level under an `orgs` key.

type Metadata

type Metadata struct {
	BillingEmail                 *string                     `json:"billing_email,omitempty"`
	Company                      *string                     `json:"company,omitempty"`
	Email                        *string                     `json:"email,omitempty"`
	Name                         *string                     `json:"name,omitempty"`
	Description                  *string                     `json:"description,omitempty"`
	Location                     *string                     `json:"location,omitempty"`
	HasOrganizationProjects      *bool                       `json:"has_organization_projects,omitempty"`
	HasRepositoryProjects        *bool                       `json:"has_repository_projects,omitempty"`
	DefaultRepositoryPermission  *github.RepoPermissionLevel `json:"default_repository_permission,omitempty"`
	MembersCanCreateRepositories *bool                       `json:"members_can_create_repositories,omitempty"`
}

Metadata declares metadata about the GitHub org.

See https://developer.github.com/v3/orgs/#edit-an-organization

type Privacy

type Privacy string

Privacy is secret or closed.

See https://developer.github.com/v3/teams/#edit-team

const (
	// Closed means it is only visible to org members
	Closed Privacy = "closed"
	// Secret means it is only visible to team members.
	Secret Privacy = "secret"
)

func (Privacy) MarshalText

func (p Privacy) MarshalText() ([]byte, error)

MarshalText returns bytes that equal secret or closed

func (*Privacy) UnmarshalText

func (p *Privacy) UnmarshalText(text []byte) error

UnmarshalText returns an error if text != secret or closed

type Repo

type Repo struct {
	Description              *string `json:"description,omitempty"`
	HomePage                 *string `json:"homepage,omitempty"`
	Private                  *bool   `json:"private,omitempty"`
	HasIssues                *bool   `json:"has_issues,omitempty"`
	HasProjects              *bool   `json:"has_projects,omitempty"`
	HasWiki                  *bool   `json:"has_wiki,omitempty"`
	AllowSquashMerge         *bool   `json:"allow_squash_merge,omitempty"`
	AllowMergeCommit         *bool   `json:"allow_merge_commit,omitempty"`
	AllowRebaseMerge         *bool   `json:"allow_rebase_merge,omitempty"`
	SquashMergeCommitTitle   *string `json:"squash_merge_commit_title,omitempty"`
	SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"`

	DefaultBranch *string `json:"default_branch,omitempty"`
	Archived      *bool   `json:"archived,omitempty"`

	Previously []string `json:"previously,omitempty"`

	OnCreate *RepoCreateOptions `json:"on_create,omitempty"`
}

Repo declares metadata about the GitHub repository

See https://developer.github.com/v3/repos/#edit

func PruneRepoDefaults

func PruneRepoDefaults(repo Repo) Repo

PruneRepoDefaults finds values in org.Repo config that matches the default values replaces them with nil pointer. This reduces the size of an org dump by omitting the fields that would be set to the same value when not set at all. See https://developer.github.com/v3/repos/#edit

type RepoCreateOptions

type RepoCreateOptions struct {
	AutoInit          *bool   `json:"auto_init,omitempty"`
	GitignoreTemplate *string `json:"gitignore_template,omitempty"`
	LicenseTemplate   *string `json:"license_template,omitempty"`
}

RepoCreateOptions declares options for creating new repos See https://developer.github.com/v3/repos/#create

type Team

type Team struct {
	TeamMetadata
	Members     []string        `json:"members,omitempty"`
	Maintainers []string        `json:"maintainers,omitempty"`
	Children    map[string]Team `json:"teams,omitempty"`

	Previously []string `json:"previously,omitempty"`

	// This is injected to the Team structure by listing privilege
	// levels on dump and if set by users will cause privileges to
	// be added on sync.
	// https://developer.github.com/v3/teams/#list-team-repos
	// https://developer.github.com/v3/teams/#add-or-update-team-repository
	Repos map[string]github.RepoPermissionLevel `json:"repos,omitempty"`
}

Team declares metadata as well as its poeple.

type TeamMetadata

type TeamMetadata struct {
	Description *string  `json:"description,omitempty"`
	Privacy     *Privacy `json:"privacy,omitempty"`
}

TeamMetadata declares metadata about the github team.

See https://developer.github.com/v3/teams/#edit-team

Jump to

Keyboard shortcuts

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