api

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectNotFound = errors.New("storyapi: project not found")
	ErrCellNotFound    = errors.New("storyapi: cell not found")
)

Functions

This section is empty.

Types

type Cell

type Cell struct {
	ID          string  `json:"id"`
	ProjectID   string  `json:"project_id"`
	Name        string  `json:"name"`
	GitRepoName *string `json:"git_repo_name,omitempty"`
	GitBranch   *string `json:"git_branch,omitempty"`
}

type CellIterator

type CellIterator interface {
	Next(ctx context.Context) (*Cell, error)
	Close(ctx context.Context) error
}

type CellService

type CellService interface {
	GetCell(ctx context.Context, cellID string) (*Cell, error)
	ListCells(ctx context.Context, filter SearchFilter) (CellIterator, error)
}

type MockCellService

type MockCellService struct {
	Cells         map[string]*Cell
	GetCellFunc   func(ctx context.Context, cellID string) (*Cell, error)
	ListCellsFunc func(ctx context.Context, filter SearchFilter) (CellIterator, error)
}

func NewMockCellService

func NewMockCellService(cells ...Cell) *MockCellService

func (*MockCellService) GetCell

func (m *MockCellService) GetCell(ctx context.Context, cellID string) (*Cell, error)

func (*MockCellService) ListCells

func (m *MockCellService) ListCells(ctx context.Context, filter SearchFilter) (CellIterator, error)

type MockProjectService

type MockProjectService struct {
	Projects       map[string]*Project
	GetProjectFunc func(ctx context.Context, projectID string) (*Project, error)
}

func NewMockProjectService

func NewMockProjectService(projects ...Project) *MockProjectService

func (*MockProjectService) GetProject

func (m *MockProjectService) GetProject(ctx context.Context, projectID string) (*Project, error)

type Project

type Project struct {
	ID            string  `json:"id"`
	GitRepoPath   string  `json:"git_repo_path"`
	GitRepoBranch *string `json:"git_repo_branch,omitempty"`
}

type ProjectService

type ProjectService interface {
	GetProject(ctx context.Context, projectID string) (*Project, error)
}

type SearchFilter

type SearchFilter struct {
	ProjectIDs []string
	Names      []string
}

Jump to

Keyboard shortcuts

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