Documentation
¶
Index ¶
- Constants
- func CanRead(format CheckpointFormat) bool
- func CanSatisfyPolicy(policy Policy) bool
- func CanWrite(format CheckpointFormat) bool
- func Compare(a, b CheckpointFormat) int
- func DefaultCheckpointVersion() string
- func Push(ctx context.Context, target Target) error
- func RequiresUpgrade(policy Policy) bool
- func SetRef(repo *git.Repository, ref plumbing.ReferenceName, hash plumbing.Hash) error
- func UnsupportedPolicyMessage(policy Policy, updateCommand string) string
- func UnsupportedWrite(policy Policy) bool
- func ValidatePolicy(policy Policy) error
- func WriteLocal(ctx context.Context, repo *git.Repository, parent plumbing.Hash, policy Policy) (plumbing.Hash, error)
- type CheckpointFamily
- type CheckpointFormat
- type Policy
- type RemoteState
- type Source
- type State
- func ReadFromRef(ctx context.Context, repo *git.Repository, refName plumbing.ReferenceName, ...) (State, error)
- func ReadLocal(ctx context.Context, repo *git.Repository) (State, error)
- func Sync(ctx context.Context, repo *git.Repository, target Target) (State, error)
- func Update(ctx context.Context, repo *git.Repository, target Target, opts UpdateOptions) (State, error)
- type Target
- type UpdateOptions
Constants ¶
View Source
const CheckpointVersionBranchV1 = "branch-v1"
CheckpointVersionBranchV1 identifies the branch-backed checkpoint format.
View Source
const PolicyFileName = "policy.json"
View Source
const RefName = plumbing.ReferenceName("refs/entire/policies/checkpoint")
Variables ¶
This section is empty.
Functions ¶
func CanRead ¶
func CanRead(format CheckpointFormat) bool
func CanSatisfyPolicy ¶ added in v0.8.0
func CanWrite ¶
func CanWrite(format CheckpointFormat) bool
func Compare ¶
func Compare(a, b CheckpointFormat) int
func DefaultCheckpointVersion ¶ added in v0.8.0
func DefaultCheckpointVersion() string
func RequiresUpgrade ¶
func SetRef ¶
func SetRef(repo *git.Repository, ref plumbing.ReferenceName, hash plumbing.Hash) error
func UnsupportedPolicyMessage ¶ added in v0.8.0
func UnsupportedWrite ¶
func ValidatePolicy ¶
Types ¶
type CheckpointFamily ¶
type CheckpointFamily string
const ( CheckpointFamilyBranch CheckpointFamily = "branch" CheckpointFamilyRefs CheckpointFamily = "refs" )
type CheckpointFormat ¶
type CheckpointFormat struct {
Family CheckpointFamily
Major int
}
func ParseFormat ¶
func ParseFormat(raw string) (CheckpointFormat, error)
func (CheckpointFormat) String ¶
func (f CheckpointFormat) String() string
type Policy ¶
type Policy struct {
CheckpointVersion string `json:"checkpoint_version,omitempty"`
CheckpointMinVersion string `json:"checkpoint_min_version,omitempty"`
}
func DefaultPolicy ¶
func DefaultPolicy() Policy
type RemoteState ¶
func CheckRemote ¶
func CheckRemote(ctx context.Context, target Target) (RemoteState, error)
type State ¶
func ReadFromRef ¶
func ReadFromRef(ctx context.Context, repo *git.Repository, refName plumbing.ReferenceName, source Source) (State, error)
func Update ¶
func Update(ctx context.Context, repo *git.Repository, target Target, opts UpdateOptions) (State, error)
Click to show internal directories.
Click to hide internal directories.