Versions in this module Expand all Collapse all v0 v0.9.1 Nov 5, 2026 Changes in this version + const DefaultAPIURL + const OtherReposNone + const OtherReposRead + const PolicyScope + const ScopeAny + const ScopeWorkspace + const SourceAllowCommand + const SourceExtraRepos + const StoreFileName + func Approve(store *Store, project string, cands []Candidate, now time.Time) error + func CommitRun(store *Store, plan *Plan, meta map[string]RepoMeta, now time.Time) error + func DefaultStorePath(moatHome string) string + func FindProject(dir string, store *Store) (string, error) + func Forget(store *Store, project string, repos []string) (notFound []string, err error) + func LookupFailureReason(err error) string + func LookupRepos(ctx context.Context, client *http.Client, apiURL, token string, repos []string) (map[string]RepoMeta, map[string]error) + func MergeHTTPPolicy(github, user []byte) ([]byte, error) + func NormalizeRepo(s string) (string, error) + func ParseRemoteURL(raw string) (string, bool) + func PolicyTemplate() []byte + func ProjectKey(workspace string) (string, error) + func RecordFirstRun(store *Store, plan *Plan, now time.Time) error + func RenderPolicy(p PolicyParams) ([]byte, error) + func Reset(store *Store, project string) (existed bool, err error) + func SetRepoMeta(store *Store, project string, meta map[string]RepoMeta) error + func ValidatePlan(store *Store, plan *Plan, meta map[string]RepoMeta) error + type Approval struct + ApprovedAt time.Time + FullName string + ID int64 + NodeIDs []string + Source string + type Candidate struct + Repo string + Sources []string + type DiscoverResult struct + Repos []Found + Truncated bool + func Discover(workspace string) (DiscoverResult, error) + type Found struct + Repo string + Sources []string + type LookupHTTPError struct + Repo string + StatusCode int + func (e *LookupHTTPError) Error() string + type Plan struct + ApprovalSnapshot *Project + Enabled bool + FirstRun bool + Granted []Candidate + LockedAt time.Time + Missing []string + OtherRepos string + Pending []Candidate + Project string + Sticky bool + Truncated bool + func BuildPlan(workspace string, settings Settings, existing *Project) (*Plan, error) + func (p *Plan) GrantedRepos() []string + type PolicyParams struct + NodeIDs []string + OtherRepos string + RepoIDs []int64 + Repos []string + func PlanPolicyParams(plan *Plan, project *Project, fresh map[string]RepoMeta) PolicyParams + type Project struct + LockedAt time.Time + OtherRepos string + Repos map[string]Approval + func (p *Project) RepoNames() []string + type RepoMeta struct + FullName string + ID int64 + NodeIDs []string + type Settings struct + ExtraRepos []string + OtherRepos string + Scope string + func (s Settings) Enabled() bool + type Store struct + func OpenStore(path string) (*Store, error) + func (s *Store) Close() error + func (s *Store) Get(project string) (*Project, error) + func (s *Store) Update(project string, fn func(*Project) (*Project, error)) error