Documentation
¶
Index ¶
- Variables
- type Actor
- type AutoReleasePolicy
- type BranchRestriction
- type Policies
- type Service
- func (s *Service) ApplyAutoRelease(ctx context.Context, actor Actor, svc, branch, env string) (string, error)
- func (s *Service) ApplyBranchRestriction(ctx context.Context, actor Actor, svc, branchRegex, env string) (string, error)
- func (s *Service) CanRelease(ctx context.Context, svc, branch, env string) (bool, error)
- func (s *Service) Delete(ctx context.Context, actor Actor, svc string, ids []string) (int, error)
- func (s *Service) Get(ctx context.Context, svc string) (Policies, error)
- func (s *Service) GetAutoReleases(ctx context.Context, svc, branch string) ([]AutoReleasePolicy, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotParsable indicates that a policies file could not be parsed against // the specification. ErrNotParsable = errors.New("policies not parsable") // ErrUnknownFields indicates that a policies file contains an unknown field. ErrUnknownFields = errors.New("policies contains unknown fields") // ErrNotFound indicates that policies are not found for a service. ErrNotFound = errors.New("not found") // ErrConflict indicates that polices are not compatible ErrConflict = errors.New("conflict") )
Functions ¶
This section is empty.
Types ¶
type AutoReleasePolicy ¶
type BranchRestriction ¶ added in v0.4.0
type Policies ¶
type Policies struct { Service string `json:"service,omitempty"` AutoReleases []AutoReleasePolicy `json:"autoReleases,omitempty"` BranchRestrictions []BranchRestriction `json:"branchRestrictions,omitempty"` }
func (*Policies) HasPolicies ¶
HasPolicies returns whether any policies are applied.
func (*Policies) SetAutoRelease ¶
SetAutoRelease sets an auto-release policy for specified branch and environment.
If an auto-release policy exists for the same environment it is overwritten.
type Service ¶ added in v0.0.15
func (*Service) ApplyAutoRelease ¶ added in v0.0.15
func (s *Service) ApplyAutoRelease(ctx context.Context, actor Actor, svc, branch, env string) (string, error)
ApplyAutoRelease applies an auto-release policy for service svc from branch to environment env.
func (*Service) ApplyBranchRestriction ¶ added in v0.4.0
func (s *Service) ApplyBranchRestriction(ctx context.Context, actor Actor, svc, branchRegex, env string) (string, error)
ApplyBranchRestriction applies a branch-restriction policy for service svc to environment env with regular expression branchRegex.
func (*Service) CanRelease ¶ added in v0.4.0
CanRelease returns whether service svc's branch can be released to env.
func (*Service) Get ¶ added in v0.0.15
Get gets stored policies for service svc. If no policies are stored ErrNotFound is returned.
func (*Service) GetAutoReleases ¶ added in v0.0.15
func (s *Service) GetAutoReleases(ctx context.Context, svc, branch string) ([]AutoReleasePolicy, error)
GetAutoReleases gets stored auto-release policies for service svc. If no policies are found a nil slice is returned.