Documentation
¶
Index ¶
- func Apply(ctx context.Context, c *gh.Client, plan util.Plan) error
- func ApplyWithOptions(ctx context.Context, c *gh.Client, plan util.Plan, opts ApplyOptions) error
- func BuildPlan(ctx context.Context, c *gh.Client, cfg *config.Root) (util.Plan, error)
- type ApplyOptions
- type Handler
- type HandlerFunc
- type HandlerRegistry
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyWithOptions ¶ added in v0.2.6
ApplyWithOptions applies the plan's changes using the given options.
Types ¶
type ApplyOptions ¶ added in v0.2.6
type ApplyOptions struct {
// ContinueOnError keeps applying remaining changes after a handler fails,
// then returns an aggregated error at the end. When false (the default),
// the first handler error aborts the run.
ContinueOnError bool
}
ApplyOptions tunes how Apply processes the change set.
type Handler ¶ added in v0.2.4
Handler applies a single planned change against GitHub.
Implementations should be idempotent where possible; the planner already filters out no-op changes, but partial failures mid-apply are possible.
type HandlerFunc ¶ added in v0.2.4
HandlerFunc adapts an ordinary function to the Handler interface.
type HandlerRegistry ¶ added in v0.2.4
type HandlerRegistry struct {
// contains filtered or unexported fields
}
HandlerRegistry resolves change kinds (scope:action) to handlers and orders them.
func NewHandlerRegistry ¶ added in v0.2.4
func NewHandlerRegistry() *HandlerRegistry
NewHandlerRegistry returns an empty registry.
func (*HandlerRegistry) Lookup ¶ added in v0.2.4
func (r *HandlerRegistry) Lookup(scope, action string) (Handler, bool)
Lookup returns the Handler registered for scope:action, if any.
func (*HandlerRegistry) Precedence ¶ added in v0.2.4
func (r *HandlerRegistry) Precedence(scope, action string) int
Precedence returns the ordering weight for scope:action. Unregistered keys sort last so unknown change kinds don't silently jump the queue.
func (*HandlerRegistry) Register ¶ added in v0.2.4
func (r *HandlerRegistry) Register(scope, action string, precedence int, h Handler)
Register binds a Handler to scope:action with the given precedence. Lower precedence runs first. Duplicate registrations panic so misconfigured registries fail fast at startup rather than during an apply.
type State ¶
type State struct {
Org string
ManagedRepos map[string]bool
// Cached API results to avoid duplicate calls
ActualTeams []*github.Team
ActualRepos []*github.Repository
// Current state from GitHub
CurrentTeams int
CurrentTeamMembers int
CurrentRepos int
CurrentRepoPerms int
CurrentCustomRoles int
// Desired state from config
DesiredTeams int
DesiredTeamMembers int
DesiredRepos int
DesiredRepoPerms int
DesiredCustomRoles int
}