Documentation
¶
Index ¶
- type GitStore
- func (g *GitStore) Archive(owner, slug, version string) (io.ReadCloser, error)
- func (g *GitStore) BasePath() string
- func (g *GitStore) Exists(owner, slug string) bool
- func (g *GitStore) GetFile(owner, slug, version, path string) ([]byte, error)
- func (g *GitStore) InitRepo(owner, slug string) error
- func (g *GitStore) ListTags(owner, slug string) ([]string, error)
- func (g *GitStore) Mirror(owner, slug, destPath string) error
- func (g *GitStore) Publish(ctx context.Context, opts PublishOpts) (string, error)
- func (g *GitStore) Rename(owner, oldSlug, newSlug string) error
- func (g *GitStore) RepoPath(owner, slug string) string
- type ImportOpts
- type ImportService
- func (i *ImportService) Enabled() bool
- func (i *ImportService) HandleWebhook(ctx context.Context, event *WebhookEvent) error
- func (i *ImportService) ImportFromURL(ctx context.Context, repoURL string, opts ImportOpts) error
- func (i *ImportService) VerifySignature(payload []byte, signature string) bool
- type MirrorService
- type PublishOpts
- type WebhookEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitStore ¶
type GitStore struct {
// contains filtered or unexported fields
}
func (*GitStore) Archive ¶
func (g *GitStore) Archive(owner, slug, version string) (io.ReadCloser, error)
Archive generates a zip archive for a version, streaming output.
type ImportOpts ¶
type ImportService ¶
type ImportService struct {
// onNewVersion is called when a new version is imported.
// It should be set by the caller (e.g., SkillService) to register the version.
OnNewVersion func(ctx context.Context, owner, slug, version string, repoPath string) error
// contains filtered or unexported fields
}
func NewImportService ¶
func NewImportService(gs *GitStore, cfg config.ImportConfig) *ImportService
func (*ImportService) Enabled ¶
func (i *ImportService) Enabled() bool
func (*ImportService) HandleWebhook ¶
func (i *ImportService) HandleWebhook(ctx context.Context, event *WebhookEvent) error
HandleWebhook processes a webhook event: fetches the repo and registers the version.
func (*ImportService) ImportFromURL ¶
func (i *ImportService) ImportFromURL(ctx context.Context, repoURL string, opts ImportOpts) error
ImportFromURL clones a repo and registers all version tags.
func (*ImportService) VerifySignature ¶
func (i *ImportService) VerifySignature(payload []byte, signature string) bool
VerifySignature verifies HMAC-SHA256 webhook signature.
type MirrorService ¶
type MirrorService struct {
// contains filtered or unexported fields
}
func NewMirrorService ¶
func NewMirrorService(gs *GitStore, cfg config.MirrorConfig) *MirrorService
func (*MirrorService) Enabled ¶
func (m *MirrorService) Enabled() bool
func (*MirrorService) PushAll ¶
func (m *MirrorService) PushAll(ctx context.Context) error
PushAll pushes all repos to the remote.
func (*MirrorService) PushMirror ¶
func (m *MirrorService) PushMirror(ctx context.Context, owner, slug string) error
PushMirror pushes a local bare repo to the configured remote.
type PublishOpts ¶
type WebhookEvent ¶
type WebhookEvent struct {
Provider string // "github", "gitlab", "gitea"
RepoURL string
Ref string // e.g., "refs/tags/v1.0.0"
Tag string // e.g., "v1.0.0"
Commit string
}
func ParseGitHubWebhook ¶
func ParseGitHubWebhook(payload []byte) (*WebhookEvent, error)
ParseGitHubWebhook parses a GitHub push webhook payload.
func ParseGitLabWebhook ¶
func ParseGitLabWebhook(payload []byte) (*WebhookEvent, error)
ParseGitLabWebhook parses a GitLab tag push webhook payload.
func ParseGiteaWebhook ¶
func ParseGiteaWebhook(payload []byte) (*WebhookEvent, error)
ParseGiteaWebhook parses a Gitea push webhook payload (same format as GitHub).
Click to show internal directories.
Click to hide internal directories.