internal

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GOLIAC_GIT_TAG = "goliac"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubBatchExecutor

type GithubBatchExecutor struct {
	// contains filtered or unexported fields
}

* GithubBatchExecutor will collects all commands to apply * if there the number of changes to apply is not too big, it will apply on the `Commit()` * Usage: * gal := NewGithubBatchExecutor(client) * gal.Begin() * gal.Create... * gal.Update... * ... * gal.Commit()

func NewGithubBatchExecutor

func NewGithubBatchExecutor(client engine.ReconciliatorExecutor, maxChangesets int) *GithubBatchExecutor

func (*GithubBatchExecutor) AddRuleset

func (g *GithubBatchExecutor) AddRuleset(dryrun bool, ruleset *engine.GithubRuleSet)

func (*GithubBatchExecutor) AddUserToOrg

func (g *GithubBatchExecutor) AddUserToOrg(dryrun bool, ghuserid string)

func (*GithubBatchExecutor) Begin

func (g *GithubBatchExecutor) Begin(dryrun bool)

func (*GithubBatchExecutor) Commit

func (g *GithubBatchExecutor) Commit(dryrun bool) error

func (*GithubBatchExecutor) CreateRepository

func (g *GithubBatchExecutor) CreateRepository(dryrun bool, reponame string, description string, writers []string, readers []string, boolProperties map[string]bool)

func (*GithubBatchExecutor) CreateTeam

func (g *GithubBatchExecutor) CreateTeam(dryrun bool, teamname string, description string, members []string)

func (*GithubBatchExecutor) DeleteRepository

func (g *GithubBatchExecutor) DeleteRepository(dryrun bool, reponame string)

func (*GithubBatchExecutor) DeleteRuleset

func (g *GithubBatchExecutor) DeleteRuleset(dryrun bool, rulesetid int)

func (*GithubBatchExecutor) DeleteTeam

func (g *GithubBatchExecutor) DeleteTeam(dryrun bool, teamslug string)

func (*GithubBatchExecutor) RemoveUserFromOrg

func (g *GithubBatchExecutor) RemoveUserFromOrg(dryrun bool, ghuserid string)

func (*GithubBatchExecutor) Rollback

func (g *GithubBatchExecutor) Rollback(dryrun bool, err error)

func (*GithubBatchExecutor) UpdateRepositoryAddTeamAccess

func (g *GithubBatchExecutor) UpdateRepositoryAddTeamAccess(dryrun bool, reponame string, teamslug string, permission string)

func (*GithubBatchExecutor) UpdateRepositoryRemoveExternalUser added in v0.2.1

func (g *GithubBatchExecutor) UpdateRepositoryRemoveExternalUser(dryrun bool, reponame string, githubid string)

func (*GithubBatchExecutor) UpdateRepositoryRemoveTeamAccess

func (g *GithubBatchExecutor) UpdateRepositoryRemoveTeamAccess(dryrun bool, reponame string, teamslug string)

func (*GithubBatchExecutor) UpdateRepositorySetExternalUser added in v0.2.1

func (g *GithubBatchExecutor) UpdateRepositorySetExternalUser(dryrun bool, reponame string, githubid string, permission string)

func (*GithubBatchExecutor) UpdateRepositoryUpdateBoolProperty added in v0.5.0

func (g *GithubBatchExecutor) UpdateRepositoryUpdateBoolProperty(dryrun bool, reponame string, propertyName string, propertyValue bool)

func (*GithubBatchExecutor) UpdateRepositoryUpdateTeamAccess

func (g *GithubBatchExecutor) UpdateRepositoryUpdateTeamAccess(dryrun bool, reponame string, teamslug string, permission string)

func (*GithubBatchExecutor) UpdateRuleset

func (g *GithubBatchExecutor) UpdateRuleset(dryrun bool, ruleset *engine.GithubRuleSet)

func (*GithubBatchExecutor) UpdateTeamAddMember

func (g *GithubBatchExecutor) UpdateTeamAddMember(dryrun bool, teamslug string, username string, role string)

role = member or maintainer (usually we use member)

func (*GithubBatchExecutor) UpdateTeamRemoveMember

func (g *GithubBatchExecutor) UpdateTeamRemoveMember(dryrun bool, teamslug string, username string)

type GithubCommand

type GithubCommand interface {
	Apply()
}

*

  • Each command/mutation we want to perform will be isloated into a GithubCommand
  • object, so we can regroup all of them to apply (or cancel) them in batch

type GithubCommandAddRuletset

type GithubCommandAddRuletset struct {
	// contains filtered or unexported fields
}

func (*GithubCommandAddRuletset) Apply

func (g *GithubCommandAddRuletset) Apply()

type GithubCommandAddUserToOrg

type GithubCommandAddUserToOrg struct {
	// contains filtered or unexported fields
}

func (*GithubCommandAddUserToOrg) Apply

func (g *GithubCommandAddUserToOrg) Apply()

type GithubCommandCreateRepository

type GithubCommandCreateRepository struct {
	// contains filtered or unexported fields
}

func (*GithubCommandCreateRepository) Apply

func (g *GithubCommandCreateRepository) Apply()

type GithubCommandCreateTeam

type GithubCommandCreateTeam struct {
	// contains filtered or unexported fields
}

func (*GithubCommandCreateTeam) Apply

func (g *GithubCommandCreateTeam) Apply()

type GithubCommandDeleteRepository

type GithubCommandDeleteRepository struct {
	// contains filtered or unexported fields
}

func (*GithubCommandDeleteRepository) Apply

func (g *GithubCommandDeleteRepository) Apply()

type GithubCommandDeleteRuletset

type GithubCommandDeleteRuletset struct {
	// contains filtered or unexported fields
}

func (*GithubCommandDeleteRuletset) Apply

func (g *GithubCommandDeleteRuletset) Apply()

type GithubCommandDeleteTeam

type GithubCommandDeleteTeam struct {
	// contains filtered or unexported fields
}

func (*GithubCommandDeleteTeam) Apply

func (g *GithubCommandDeleteTeam) Apply()

type GithubCommandRemoveUserFromOrg

type GithubCommandRemoveUserFromOrg struct {
	// contains filtered or unexported fields
}

func (*GithubCommandRemoveUserFromOrg) Apply

func (g *GithubCommandRemoveUserFromOrg) Apply()

type GithubCommandUpdateRepositoryAddTeamAccess

type GithubCommandUpdateRepositoryAddTeamAccess struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateRepositoryAddTeamAccess) Apply

type GithubCommandUpdateRepositoryRemoveExternalUser added in v0.2.1

type GithubCommandUpdateRepositoryRemoveExternalUser struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateRepositoryRemoveExternalUser) Apply added in v0.2.1

type GithubCommandUpdateRepositoryRemoveTeamAccess

type GithubCommandUpdateRepositoryRemoveTeamAccess struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateRepositoryRemoveTeamAccess) Apply

type GithubCommandUpdateRepositorySetExternalUser added in v0.2.1

type GithubCommandUpdateRepositorySetExternalUser struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateRepositorySetExternalUser) Apply added in v0.2.1

type GithubCommandUpdateRepositoryUpdateBoolProperty added in v0.5.0

type GithubCommandUpdateRepositoryUpdateBoolProperty struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateRepositoryUpdateBoolProperty) Apply added in v0.5.0

type GithubCommandUpdateRepositoryUpdateTeamAccess

type GithubCommandUpdateRepositoryUpdateTeamAccess struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateRepositoryUpdateTeamAccess) Apply

type GithubCommandUpdateRuletset

type GithubCommandUpdateRuletset struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateRuletset) Apply

func (g *GithubCommandUpdateRuletset) Apply()

type GithubCommandUpdateTeamAddMember

type GithubCommandUpdateTeamAddMember struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateTeamAddMember) Apply

type GithubCommandUpdateTeamRemoveMember

type GithubCommandUpdateTeamRemoveMember struct {
	// contains filtered or unexported fields
}

func (*GithubCommandUpdateTeamRemoveMember) Apply

type GithubWebhookServer added in v0.6.0

type GithubWebhookServer interface {
	// Start the server
	Start() error
	Shutdown() error
}

GithubWebhookServer is the interface for the webhook server It will wait for a Github webhook event and call the callback function when a merge event is received on the main branch

func NewGithubWebhookServerImpl added in v0.6.0

func NewGithubWebhookServerImpl(httpaddr string, httpport int, webhookPath string, secret string, mainBranch string, callback GithubWebhookServerCallback) GithubWebhookServer

type GithubWebhookServerCallback added in v0.6.0

type GithubWebhookServerCallback func()

type GithubWebhookServerImpl added in v0.6.0

type GithubWebhookServerImpl struct {
	// contains filtered or unexported fields
}

func (*GithubWebhookServerImpl) Shutdown added in v0.6.0

func (s *GithubWebhookServerImpl) Shutdown() error

func (*GithubWebhookServerImpl) Start added in v0.6.0

func (s *GithubWebhookServerImpl) Start() error

func (*GithubWebhookServerImpl) WebhookHandler added in v0.6.0

func (s *GithubWebhookServerImpl) WebhookHandler(w http.ResponseWriter, r *http.Request)

type Goliac

type Goliac interface {
	// will run and apply the reconciliation
	Apply(dryrun bool, repositoryUrl, branch string, forcesync bool) error

	// will clone run the user-plugin to sync users, and will commit to the team repository
	UsersUpdate(repositoryUrl, branch string, dryrun bool, force bool) error

	// flush remote cache
	FlushCache()

	GetLocal() engine.GoliacLocalResources
}

* Goliac is the main interface of the application. * It is used to load and validate a goliac repository and apply it to github.

func NewGoliacImpl

func NewGoliacImpl() (Goliac, error)

type GoliacImpl

type GoliacImpl struct {
	// contains filtered or unexported fields
}

func (*GoliacImpl) Apply added in v0.3.0

func (g *GoliacImpl) Apply(dryrun bool, repositoryUrl, branch string, forcesync bool) error

func (*GoliacImpl) FlushCache

func (g *GoliacImpl) FlushCache()

func (*GoliacImpl) GetLocal added in v0.2.0

func (g *GoliacImpl) GetLocal() engine.GoliacLocalResources

func (*GoliacImpl) UsersUpdate

func (g *GoliacImpl) UsersUpdate(repositoryUrl, branch string, dryrun bool, force bool) error

type GoliacLight added in v0.2.0

type GoliacLight interface {
	// Validate a local teams directory
	Validate(path string) error
}

* This "version" of Goliac is here just to validate a local * teams directory. It is mainly used for CI purpose when we need to validate * a PR

func NewGoliacLightImpl added in v0.2.0

func NewGoliacLightImpl() (GoliacLight, error)

type GoliacLightImpl added in v0.2.0

type GoliacLightImpl struct {
	// contains filtered or unexported fields
}

func (*GoliacLightImpl) Validate added in v0.2.0

func (g *GoliacLightImpl) Validate(path string) error

type GoliacServer

* GoliacServer is here to run as a serve that * - sync/reconciliate periodically * - provide a REST API server

func NewGoliacServer

func NewGoliacServer(goliac Goliac, notificationService notification.NotificationService) GoliacServer

type GoliacServerImpl

type GoliacServerImpl struct {
	// contains filtered or unexported fields
}

func (*GoliacServerImpl) GetCollaborator added in v0.2.2

func (g *GoliacServerImpl) GetCollaborator(params app.GetCollaboratorParams) middleware.Responder

func (*GoliacServerImpl) GetCollaborators added in v0.2.2

func (*GoliacServerImpl) GetLiveness

func (*GoliacServerImpl) GetReadiness

func (*GoliacServerImpl) GetRepositories added in v0.2.0

func (*GoliacServerImpl) GetRepository added in v0.2.0

func (g *GoliacServerImpl) GetRepository(params app.GetRepositoryParams) middleware.Responder

func (*GoliacServerImpl) GetStatus added in v0.2.0

func (*GoliacServerImpl) GetTeam added in v0.2.0

func (*GoliacServerImpl) GetTeams added in v0.2.0

func (*GoliacServerImpl) GetUser added in v0.2.0

func (*GoliacServerImpl) GetUsers added in v0.2.0

func (*GoliacServerImpl) PostFlushCache added in v0.2.0

func (*GoliacServerImpl) PostResync added in v0.2.0

func (*GoliacServerImpl) Serve

func (g *GoliacServerImpl) Serve()

func (*GoliacServerImpl) StartRESTApi

func (g *GoliacServerImpl) StartRESTApi() (*restapi.Server, error)

type LoadGithubSamlUsers

type LoadGithubSamlUsers func() (map[string]*entity.User, error)

type PullRequest added in v0.6.0

type PullRequest struct {
	Action string `json:"action"`
	Merged bool   `json:"merged"`
	Base   struct {
		Ref string `json:"ref"`
	} `json:"base"`
}

type PushEvent added in v0.6.0

type PushEvent struct {
	Ref string `json:"ref"`
}

type Scaffold

type Scaffold struct {
	// contains filtered or unexported fields
}

func NewScaffold

func NewScaffold() (*Scaffold, error)

func (*Scaffold) Generate

func (s *Scaffold) Generate(rootpath string, adminteam string) error

* Generate will generate a full teams directory structure compatible with Goliac

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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