project

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameRequired    = errors.New("name is required")
	ErrSrvPathNotValid = errors.New("service path is not valid")
	ErrRepoURLNotValid = errors.New("repo url is not valid")
	ErrLoadFromFile    = errors.New("cannot load from file")
)
View Source
var (
	Repos = []Repo{
		{
			Git: "https://gitlab.com/macroscope-lab/atomika.git",
			Go:  "gitlab.com/macroscope-lab/atomika",
		},
	}
)

Functions

func DefDirExists

func DefDirExists(p string) bool

func GenerateID

func GenerateID(name string) string

func GoModuleName

func GoModuleName(id string) string

func IsService

func IsService(p string) bool

func Validate

func Validate(name, repo, srvPath string) (err error)

Types

type Project

type Project struct {
	ID           string `json:"id"`
	ModName      string `json:"-"`
	Repo         string `json:"repo"`
	ServicesPath string `json:"servicesPath"`
	// contains filtered or unexported fields
}

func LoadFromFile

func LoadFromFile() (*Project, error)

func New

func New(name, repo, srvPath string) (*Project, error)

func (*Project) MarshalBinary

func (p *Project) MarshalBinary() ([]byte, error)

MarshalBinary converts to bytes

func (*Project) MarshalIndentBinary

func (p *Project) MarshalIndentBinary() ([]byte, error)

MarshalIndentBinary converts to bytes

func (*Project) ServicePath

func (p *Project) ServicePath(name string) string

ServicePath will create a valid path according to Project struct details this DOES NOT guarantee in any way the package exists

func (*Project) UnmarshalBinary

func (p *Project) UnmarshalBinary(data []byte) error

UnmarshalBinary convert data to Project

type Repo

type Repo struct {
	Git string
	Go  string
}

type StructFile

type StructFile string
const (
	GitIgnoreFile     StructFile = ".gitignore"
	MainFile          StructFile = "main.go"
	LocalFile         StructFile = "local.json"
	GoModFile         StructFile = "go.mod"
	ConfigFileProject StructFile = "project.json"

	DefDirService             = "def"
	ErrFile        StructFile = "errors.go"
	DefinitionFile StructFile = "definitions.go"
	ConsumerFile   StructFile = "consumer.go"
	ServerFile     StructFile = "server.go"
	ServiceFile    StructFile = "service.go"
	TestFile       StructFile = "service_test.go"

	ClientGoFile StructFile = "client.go"
	ClientJsFile StructFile = "client.js"
	ClientTsFile StructFile = "client.ts"
)

func (StructFile) Name

func (sf StructFile) Name() string

func (StructFile) Tmpl

func (sf StructFile) Tmpl() string

Jump to

Keyboard shortcuts

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