service

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadMultipartFiles

func ReadMultipartFiles(form *multipart.Form) (map[string][]byte, error)

ReadMultipartFiles reads all files from a multipart form.

Types

type PublishRequest

type PublishRequest struct {
	Slug        string
	Version     string
	Changelog   string
	DisplayName string
	Summary     string
	Tags        []string
	Files       map[string][]byte // path → content
}

type SkillService

type SkillService struct {
	// contains filtered or unexported fields
}

func NewSkillService

func NewSkillService(
	skillRepo *repository.SkillRepo,
	versionRepo *repository.VersionRepo,
	userRepo *repository.UserRepo,
	downloadRepo *repository.DownloadRepo,
	starRepo *repository.StarRepo,
	gs *gitstore.GitStore,
	sc *search.Client,
	ms *gitstore.MirrorService,
) *SkillService

func (*SkillService) Download

func (s *SkillService) Download(ctx context.Context, slug, version string, identityHash string) (io.ReadCloser, string, error)

Download returns a zip archive for a skill version.

func (*SkillService) GetFile

func (s *SkillService) GetFile(ctx context.Context, slug, version, path string) ([]byte, error)

GetFile reads a single file from a skill version.

func (*SkillService) GetSkill

func (s *SkillService) GetSkill(ctx context.Context, slug string) (*model.SkillWithOwner, error)

GetSkill returns a skill by slug.

func (*SkillService) GetVersion

func (s *SkillService) GetVersion(ctx context.Context, slug, version string) (*model.SkillVersion, error)

GetVersion returns a specific version.

func (*SkillService) GetVersions

func (s *SkillService) GetVersions(ctx context.Context, slug string) ([]model.SkillVersion, error)

GetVersions returns all versions for a skill.

func (*SkillService) ListSkills

func (s *SkillService) ListSkills(ctx context.Context, limit int, cursor, sort string) ([]model.SkillWithOwner, string, error)

ListSkills returns a paginated list of skills.

func (*SkillService) PublishVersion

func (s *SkillService) PublishVersion(ctx context.Context, user *model.User, req PublishRequest) (*model.SkillWithOwner, *model.SkillVersion, error)

func (*SkillService) ResolveFingerprint

func (s *SkillService) ResolveFingerprint(ctx context.Context, fingerprint string) (*model.SkillVersion, *model.SkillWithOwner, error)

ResolveFingerprint finds a version by its fingerprint.

func (*SkillService) SoftDelete

func (s *SkillService) SoftDelete(ctx context.Context, user *model.User, slug string) error

SoftDelete soft-deletes a skill.

func (*SkillService) Star

func (s *SkillService) Star(ctx context.Context, userID uuid.UUID, slug string) error

Star adds a star to a skill.

func (*SkillService) Undelete

func (s *SkillService) Undelete(ctx context.Context, user *model.User, slug string) error

Undelete restores a soft-deleted skill.

func (*SkillService) Unstar

func (s *SkillService) Unstar(ctx context.Context, userID uuid.UUID, slug string) error

Unstar removes a star from a skill.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL