org

package
v0.0.0-...-bbc7888 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 1 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  *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"`

	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

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 RepoPermissionLevel

type RepoPermissionLevel string

RepoPermissionLevel is admin, write, read or none.

See https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level

const (
	// Read allows pull but not push
	Read RepoPermissionLevel = "read"
	// Triage allows Read and managing issues
	// pull requests but not push
	Triage RepoPermissionLevel = "triage"
	// Write allows Read plus push
	Write RepoPermissionLevel = "write"
	// Maintain allows Write along with managing
	// repository without access to sensitive or
	// destructive instructions.
	Maintain RepoPermissionLevel = "maintain"
	// Admin allows Write plus change others' rights.
	Admin RepoPermissionLevel = "admin"
	// None disallows everything
	None RepoPermissionLevel = "none"
)

For more information on access levels, see: https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization

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]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