service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package service contains the domain layer for the service struct. The service struct is the main entity of the application.

Index

Constants

This section is empty.

Variables

Functions

func ValidType added in v0.2.0

func ValidType(ty Type) bool

Types

type Id

type Id string

type Lint

type Lint string

type Repository

type Repository interface {
	// All returns all services
	All() ([]*Service, error)
	// One returns one service
	One(id Id) (*Service, error)

	RemoveDirectory(path string) error

	RemoveFile(path string) error

	ServiceScriptFilePath(id Id) (string, error)

	ServicePath(id Id) string

	ServiceDependenciesPath(s *Service) (string, error)

	FileExists(file string) bool

	AllFileExists(files []string) bool

	AnyFileExists(files []string) bool

	CreateDependencies(service *Service) error

	FindDependenciesById(id Id) ([]string, error)

	CreateTypeFile(*Service) error

	CreateFile(path string, content []byte, perm int) error

	CreateDirectory(path string, perm int) error
}

Repository is the interface for the service repository

type Service

type Service struct {
	Id           Id
	Type         Type
	Dependencies []Id
	Lints        []Lint
	Valid        bool
	Path         string
}

func NewService

func NewService(id Id) *Service

func (*Service) AddDependency

func (s *Service) AddDependency(dependency string)

func (*Service) AddLint

func (s *Service) AddLint(lint string)

type StepCollection

type StepCollection struct {
	Repo    Repository
	Service *Service
	Steps   []func(repo Repository, s *Service) error
}

func (StepCollection) Iterate

func (c StepCollection) Iterate() error

Iterate implements the StepIterator interface

type StepIterator

type StepIterator interface {
	Iterate() error
}

type Type

type Type string
const (
	TypeOneshot Type = "oneshot"
	TypeLongrun Type = "longrun"
	TypeBundle  Type = "bundle"
)

Jump to

Keyboard shortcuts

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