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
Name | Type | Desctription |
---|---|---|
name | string | unique name of user |
string | email of user | |
passord | string | password of user |
CommandTemplate
Name | Type | Desctription |
---|---|---|
name | string | command template name |
description | string | description of command template |
commandName | string | name of command |
templateParams | []types.CommandParam | changeable params |
constantParams | []types.CommandParam | nonchangeable params |
CommandParam
Name | Type | Desctription |
---|---|---|
name | string | param name |
description | string | description of param |
value | []string | value. Empty if TypeString, TypeEmpty |
type | CommandParamType | type of value |
defaultValue | string | default value |
CommandParamType
CommandParamType -> int
constants -- [
TypeString -> 0
TypePopupMenu -> 1
TypeEmpty -> 2
TypeNameless -> 3
]
Endpoints NonVersioned
base endpoint: /api
/reg POST
Registration endpoint
Request:
Name | Type | Desctription |
---|---|---|
name | string | unique name of user |
string | email of user | |
passord | string | password of user |
Response:
Representation of Types.User
Name | Type | Desctription |
---|---|---|
id | string | id of user |
name | string | name of user |
string | email of user |
/auth POST
Authentication endpoint
Request
Name | Type | Desctription |
---|---|---|
name | string | name of user |
passord | string | password of user |
Response:
Name | Type | Desctription |
---|---|---|
token | string | auth token |
user | Types.User | user data |
Endpoints Versioned
authorized
base endpoint: /api/v1
/command GET
Get all commands of current user
Request
-
Response:
Name | Type | Desctription |
---|---|---|
[]Types.CommandTemplate | array of commands |
/command POST
Creates new command for current user
Request (createCommandTemplateParams)
Name | Type | Desctription |
---|---|---|
name | string | short name of command template |
description | string | description of command template |
commandName | string | name of command |
templateParams | []Types.CommandParam | changeable params |
constantParams | []Types.CommandParam | nonchangeable params |
Response
Name | Type | Desctription |
---|---|---|
Types.CommandTemplate |
/command/:id PUT
Updated certain command(by id) for current user
Request =createCommandTemplateParams
Response
Name | Type | Desctription |
---|---|---|
updated | string | id of updated command |
/command/search/:name GET
Get all commandtemplates where name contains :name
Request
-
Response
Name | Type | Desctription |
---|---|---|
[]Types.CommandTemplate | list of found commandTemplates |
/user DELETE
delete current user
Request
-
Response
"success"
/user GET
get current user info
Request
-
Response
Name | Type | Desctription |
---|---|---|
Types.User | current user info |