kpc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright Anton Feldmann

KPC is a Karel package managemant file. This structure is used to inform the tools about the structure of the project

KPC is a Karel package managemant file. This structure is used to inform the tools about the structure of the project

KPC is a Karel package managemant file. This structure is used to inform the tools about the structure of the project

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

KPC is a Karel package managemant file.

This module will handle the file.

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

KPC is a Karel package managemant file. This structure is used to inform the tools about the structure of the project

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

packages can depend on different pages. This structure will list all information

KPC is a Karel package management structure. This structure is used to inform the tools about the structure of the project

Index

Constants

View Source
const KpcVersion = "0.2.0"

the system of this packing systems

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string `toml:"name"`
	Email string `toml:"email"`
}

a package has to be written by atleased one author an author is defined by name and the email

func InitAuthor

func InitAuthor(name string) *Author

an author needs atleased a name

the email is set to an empty string.

@param {string} name the author name

@return {*Author} the author structure

func (*Author) GetEmail

func (auth *Author) GetEmail() *string

get email of author get the author's email

this function is pagt of the Author structure

@return {*string} the Email address

func (*Author) GetName

func (auth *Author) GetName() *string

get name of author get the author's name

this function is pagt of the Author structure

@return {*string} the Author's name

func (*Author) SetEmail

func (auth *Author) SetEmail(email string)

set a new email address each author has a empty email address

this function is pagt of the Author structure

@param {string} email. The email address for the author

func (*Author) SetName

func (auth *Author) SetName(name string)

set a new name. each author has a name. Maybe if the name was written wrong. This method change the name

this function is pagt of the Author structure

@param {string} name. the new name for the author

type Conflict

type Conflict struct {
	Name     string   `toml:"name"`
	Versions []string `toml:"versions"`
}

different projects can contain different conflicts on the given requirements

a conflict is targeted with a project name and one or different version of this project

func InitConflict

func InitConflict(name, version string) *Conflict

building a conflict information

a conflict has to start with a name and one version. if there is non name then there is not conflict and if there is not a start version, then there is no conflict

@param {string} name the name of the conflicting project @param {string} version the version of the conflict

@return {*Conflict} the conflict information

func (*Conflict) AddElement

func (con *Conflict) AddElement(version string)

add an version number

another version can be added to the version set.

@param {string} version the version to add to the list of conflicts

func (*Conflict) ChangeVersion

func (con *Conflict) ChangeVersion(old, new_str string) bool

change a version, because the error is not happen anymore or the version string is wrong

@param {string} old the old number @param {string} new the replaycement

@return {bool} the version is changed

func (*Conflict) ContainsVersion

func (con *Conflict) ContainsVersion(version string) bool

contains the version is the requested version into the set of versions

@param {string} the version to check

@return {bool} true if the version is in the list else false

func (*Conflict) GetLength

func (con *Conflict) GetLength() int

the number of versions for that project that builds into conflicts

@return {int} the number of known versions for a conflict

func (*Conflict) GetName

func (con *Conflict) GetName() *string

get the name of the package that triggers the error

@return {*string} the name of the project

func (*Conflict) RejectVersion

func (con *Conflict) RejectVersion(version string)

reject a version from the list of conflicts. If a version is deleted then the list is resized. if the list has only one element, then the element cannot deleted. you need atlease one version to have a conflict

@param {string} version the version to delete

func (*Conflict) SetName

func (con *Conflict) SetName(name string)

set the name. Maybe the project name changes or the name is wrong

@param {string} name the new name for the project

type KPC

type KPC struct {
	/********************             KPC          ********************/
	KPC_Version string `toml:"kpc_version"` // version of the kpc

	/******************** Package information data ********************/
	Name         string        `toml:"name"`                   // project name
	Description  string        `toml:"description,omitempty"`  // project discription
	Version      string        `toml:"version"`                // project version
	Homepage     string        `toml:"url,omitempty"`          // project homepage
	Requirements []Requirement `toml:"requirements,omitempty"` // dependnency list
	Conflicts    []Conflict    `toml:"conflicts"`              // known conflicts
	Authors      []Author      `toml:"authors"`                // authorname
	Repository   Repository    `toml:"source"`                 // sorce code repository url
	Issue        string        `toml:"issues,omitempty"`       // project issue homepage
	Keywords     []string      `toml:"keywords,omitempty"`     // project issue homepage

	/********************* Package path settings***********************/
	/*Package path settings*/
	Prefix     string `toml:"prefix"`               // root path where the packge is installed
	SrcDir     string `toml:"srcdir,omitempty"`     // installation path to project sourcefiles (*.kl)
	TypeDir    string `toml:"typedir,omitempty"`    // installation path of project typefiles (*.t.kl)
	IncludeDir string `toml:"includedir,omitempty"` // installation path to project headerfiles (*.h.kl)
	ConstDir   string `toml:"constdir,omitempty"`   // installation path of the constant diclaraion files (*.c.kl)
	FormDir    string `toml:"formdir,omitempty"`    // the files might be in an directory (*.ftx)
	DictDir    string `toml:"dictdir,omitempty"`    // dictionaries are available for the (*.utx)

	/*************** specific file includes ***************************/
	Main     string   `toml:"main,omitempty"`     // the source file to compile
	Dicts    []string `toml:"dict,omitempty"`     // dictionary file
	Forms    []string `toml:"form,omitempty"`     // form file
	Types    []string `toml:"types,omitempty"`    // the library for
	Includes []string `toml:"includes,omitempty"` // specific header files for comilation
	Consts   []string `toml:"consts,omitempty"`   // the const files of this project
}

func From

func From(toml_str []byte) *KPC

convert the TOML string to a kpc object

func InitKPC

func InitKPC(name string) *KPC

initilize a KPC object

func ReadKPCFile

func ReadKPCFile(filepath string) *KPC

read kpc structure from toml file

func (*KPC) AddAuthor

func (kpc_obj *KPC) AddAuthor(aut Author)

add an author to the list

func (*KPC) AddConflict

func (kpc_obj *KPC) AddConflict(con Conflict)

you found a new conflict so add the conflict to the list

func (*KPC) AddConst

func (kpc_obj *KPC) AddConst(con string)

add a new file with constant parameters

@param {string} path to constant parameter file

func (*KPC) AddDict

func (kpc_obj *KPC) AddDict(dict string)

func (*KPC) AddForm

func (kpc_obj *KPC) AddForm(form string)

func (*KPC) AddInclude

func (kpc_obj *KPC) AddInclude(inc string)

func (*KPC) AddRepo

func (kpc_obj *KPC) AddRepo(repo Repository)

func (*KPC) AddRequirement

func (kpc_obj *KPC) AddRequirement(req Requirement)

add a requirement

func (*KPC) AddType

func (kpc_obj *KPC) AddType(type_ string)

func (*KPC) AuthorsSize

func (kpc_obj *KPC) AuthorsSize() int

how many authors are working on this package

func (*KPC) ConflictSize

func (kpc_obj *KPC) ConflictSize() int

how many conflicts are known

func (*KPC) ConstsSize

func (kpc_obj *KPC) ConstsSize() int

func (*KPC) ContainKeyword

func (kpc_obj *KPC) ContainKeyword(key string) (bool, string)

does the kexword exist

func (*KPC) DictsSize

func (kpc_obj *KPC) DictsSize() int

func (*KPC) FormsSize

func (kpc_obj *KPC) FormsSize() int

func (*KPC) GetAuthor

func (kpc_obj *KPC) GetAuthor(name string) *Author

the the author

func (*KPC) GetConflict

func (kpc_obj *KPC) GetConflict(name string) *Conflict

get a specific conflict

func (*KPC) GetConflicts

func (kpc_obj *KPC) GetConflicts() []Conflict

get conflicts

func (*KPC) GetConst

func (kpc_obj *KPC) GetConst(con string) *string

get on constant file path utilizing specific name

@param {string} constant file name @return {string*} path to file

func (*KPC) GetConstDir

func (kpc_obj *KPC) GetConstDir() *string

func (*KPC) GetConsts

func (kpc_obj *KPC) GetConsts() []string

get the list of constant parameter files

@return {string array} list of strings

func (*KPC) GetDescription

func (kpc_obj *KPC) GetDescription() *string

get the desctiption

func (*KPC) GetDict

func (kpc_obj *KPC) GetDict(dict string) *string

func (*KPC) GetDictDir

func (kpc_obj *KPC) GetDictDir() *string

func (*KPC) GetDicts

func (kpc_obj *KPC) GetDicts() []string

func (*KPC) GetForm

func (kpc_obj *KPC) GetForm(form string) *string

func (*KPC) GetFormDir

func (kpc_obj *KPC) GetFormDir() *string

func (*KPC) GetForms

func (kpc_obj *KPC) GetForms() []string

func (*KPC) GetHomepage

func (kpc_obj *KPC) GetHomepage() *string

get the referenced homepage

func (*KPC) GetInclude

func (kpc_obj *KPC) GetInclude(inc string) *string

func (*KPC) GetIncludeDir

func (kpc_obj *KPC) GetIncludeDir() *string

func (*KPC) GetIncludes

func (kpc_obj *KPC) GetIncludes() []string

func (*KPC) GetIssue

func (kpc_obj *KPC) GetIssue() *string

the the issue reference page

func (*KPC) GetKPCVersion

func (kpc_obj *KPC) GetKPCVersion() string

return KPC version version

func (*KPC) GetKeywords

func (kpc_obj *KPC) GetKeywords() []string

get all keqwords

func (*KPC) GetMainSourceFile

func (kpc_obj *KPC) GetMainSourceFile() *string

karel has amain program file. this method will have return the handle

@return {string} name of the file with

func (*KPC) GetName

func (kpc_obj *KPC) GetName() *string

get project name

func (*KPC) GetPrefix

func (kpc_obj *KPC) GetPrefix() *string

func (*KPC) GetRepo

func (kpc_obj *KPC) GetRepo() *Repository

get the repository

func (*KPC) GetRequirement

func (kpc_obj *KPC) GetRequirement(name string) *Requirement

get all rewuirements

func (*KPC) GetSourceDir

func (kpc_obj *KPC) GetSourceDir() *string

func (*KPC) GetType

func (kpc_obj *KPC) GetType(type_ string) *string

func (*KPC) GetTypeDir

func (kpc_obj *KPC) GetTypeDir() *string

func (*KPC) GetTypes

func (kpc_obj *KPC) GetTypes() []string

func (*KPC) GetVersion

func (kpc_obj *KPC) GetVersion() *string

get the package version

func (*KPC) IncludesSize

func (kpc_obj *KPC) IncludesSize() int

func (*KPC) RejectAuthor

func (kpc_obj *KPC) RejectAuthor(name string)

delete a author from the package

func (*KPC) RejectConflict

func (kpc_obj *KPC) RejectConflict(name string)

you did well and fixed an issue. then delete the conflict

func (*KPC) RejectConst

func (kpc_obj *KPC) RejectConst(name string)

func (*KPC) RejectDict

func (kpc_obj *KPC) RejectDict(name string)

func (*KPC) RejectForm

func (kpc_obj *KPC) RejectForm(name string)

func (*KPC) RejectInclude

func (kpc_obj *KPC) RejectInclude(name string)

func (*KPC) RejectRequirement

func (kpc_obj *KPC) RejectRequirement(name string)

delete a requirement

func (*KPC) RejectType

func (kpc_obj *KPC) RejectType(name string)

func (*KPC) RequirementSize

func (kpc_obj *KPC) RequirementSize() int

how many requirements are stored

func (*KPC) SetConstDir

func (kpc_obj *KPC) SetConstDir(path string)

func (*KPC) SetDescription

func (kpc_obj *KPC) SetDescription(desc string)

set description

func (*KPC) SetDictDir

func (kpc_obj *KPC) SetDictDir(path string)

func (*KPC) SetFormDir

func (kpc_obj *KPC) SetFormDir(path string)

func (*KPC) SetHomepage

func (kpc_obj *KPC) SetHomepage(url string)

set the homepage

func (*KPC) SetIncludeDir

func (kpc_obj *KPC) SetIncludeDir(path string)

func (*KPC) SetIssue

func (kpc_obj *KPC) SetIssue(issue string)

set the issue page

func (*KPC) SetKeyword

func (kpc_obj *KPC) SetKeyword(key string)

set a new keyword

func (*KPC) SetMainSourceFile

func (kpc_obj *KPC) SetMainSourceFile(name string)

set the name of the main program file

@param {strig} file name

func (*KPC) SetName

func (kpc_obj *KPC) SetName(name string)

get the project name

func (*KPC) SetPrefix

func (kpc_obj *KPC) SetPrefix(path string)

func (*KPC) SetSourceDir

func (kpc_obj *KPC) SetSourceDir(path string)

func (*KPC) SetTypeDir

func (kpc_obj *KPC) SetTypeDir(path string)

func (*KPC) SetVersion

func (kpc_obj *KPC) SetVersion(version string)

set the current package version

func (*KPC) To

func (kpc_obj *KPC) To() *string

To() creates a TOML file with all informations

func (*KPC) TypesSize

func (kpc_obj *KPC) TypesSize() int

type Repository

type Repository struct {
	URL string `toml:"url"`
	Tag string `toml:"tag"`
}

Repository is a structure to represend the developmentfiles the basic repository protocol is git the tag is the hash in the git tree.

func InitRepository

func InitRepository() *Repository

init a repo with default values

func (*Repository) GetTag

func (repo *Repository) GetTag() *string

get a tag

func (*Repository) GetURL

func (repo *Repository) GetURL() *string

get project url

func (*Repository) SetTag

func (repo *Repository) SetTag(tag string)

set a tag

func (*Repository) SetURL

func (repo *Repository) SetURL(address string)

set the url

type Requirement

type Requirement struct {
	Name    string `toml:"name"`
	Version string `toml:"version"`
}

packages can contain requirements. this methods readout the information of additional KPC packages. if the packages are not available, then the program is not buildable

func InitRequirement

func InitRequirement(name string) *Requirement

build a Requirement structure to speedup the workflow. the name of the requirement is mandatory, The default Version is '0.1.0'

@param {string} the name of the requirements

@return {*Requirement} The Structure ony containing the base information

func (*Requirement) GetName

func (req *Requirement) GetName() *string

get name of requirement get the requirement name

this function is pagt of the Requirement structure

@return {*string} the requirement name

func (*Requirement) GetVersion

func (req *Requirement) GetVersion() *string

get version of requirement get the requirement version

this function is pagt of the Requirement structure

@return {*string} the requirement version

func (*Requirement) SetName

func (req *Requirement) SetName(name string)

set a new name. each project has a name. Maybe if the name was written wrong or changed druing time of process. This method change the name

this function is pagt of the Requirement structure

@param {string} name. the new name for the requirement

func (*Requirement) SetVersion

func (req *Requirement) SetVersion(version string)

set a new version number each project starts with version '0.1.0'

this function is pagt of the Requirement structure

@param {string} version. the version can set by each user

Jump to

Keyboard shortcuts

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