Categorygithub.com/de4et/command-constructor
modulepackage
0.0.0-20250123224122-752400102391
Repository: https://github.com/de4et/command-constructor.git
Documentation: pkg.go.dev

# README

command-constructor

Content

API V1

Types

User

NameTypeDesctription
namestringunique name of user
emailstringemail of user
passordstringpassword of user

CommandTemplate

NameTypeDesctription
namestringcommand template name
descriptionstringdescription of command template
commandNamestringname of command
templateParams[]types.CommandParamchangeable params
constantParams[]types.CommandParamnonchangeable params

CommandParam

NameTypeDesctription
namestringparam name
descriptionstringdescription of param
value[]stringvalue. Empty if TypeString, TypeEmpty
typeCommandParamTypetype of value
defaultValuestringdefault value

CommandParamType

CommandParamType -> int

constants -- [
TypeString -> 0
TypePopupMenu -> 1
TypeEmpty -> 2
TypeNameless -> 3
]

Endpoints NonVersioned

base endpoint: /api

/reg POST

Registration endpoint

Request:

NameTypeDesctription
namestringunique name of user
emailstringemail of user
passordstringpassword of user

Response:

Representation of Types.User

NameTypeDesctription
idstringid of user
namestringname of user
emailstringemail of user

/auth POST

Authentication endpoint

Request

NameTypeDesctription
namestringname of user
passordstringpassword of user

Response:

NameTypeDesctription
tokenstringauth token
userTypes.Useruser data

Endpoints Versioned

authorized

base endpoint: /api/v1

/command GET

Get all commands of current user

Request

-

Response:

NameTypeDesctription
[]Types.CommandTemplatearray of commands

/command POST

Creates new command for current user

Request (createCommandTemplateParams)

NameTypeDesctription
namestringshort name of command template
descriptionstringdescription of command template
commandNamestringname of command
templateParams[]Types.CommandParamchangeable params
constantParams[]Types.CommandParamnonchangeable params

Response

NameTypeDesctription
Types.CommandTemplate

/command/:id PUT

Updated certain command(by id) for current user

Request =createCommandTemplateParams

Response

NameTypeDesctription
updatedstringid of updated command

/command/search/:name GET

Get all commandtemplates where name contains :name

Request

-

Response

NameTypeDesctription
[]Types.CommandTemplatelist of found commandTemplates

/user DELETE

delete current user

Request

-

Response

"success"


/user GET

get current user info

Request

-

Response

NameTypeDesctription
Types.Usercurrent user info

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
templ: version: v0.3.819.