Building a Dispatching Server using Golang programming language and Golang Cobra package with tls license and Sqlite database. The main idea of this project is to learn Cobra package and working with tls license.
In this application you can create a task then you can run it or change it or delete it. You can also see the list of the tasks and their status.
- Golang Cobra
- TLS certification
- Sqlite
Cobra is a powerful library and tool in Golang that is used to create CLI (Command-Line Interface) applications. Cobra does this by providing tools that automate the process and provide key abstractions that increase developer productivity.
Read more about Cobra.
List of project commands:
serve
: starting dispatching servermigrate
: migrating databasecrypto
: generate certification files
Transport Layer Security (TLS) certificates—most commonly known as SSL, or digital certificates—are the foundation of a safe and secure internet.
TLS/SSL certificates secure internet connections by encrypting data sent between your browser, the website you’re visiting, and the website server. They ensure that data is transmitted privately and without modifications, loss or theft.
Read more about TLS.
Clone the repository and enter into main directory.
You can create new TLS files:
go run main.go crypto
To create a SQLite database:
go run main.go migrate
Start server:
go run main.go serve
/tasks/{page?}
GET- page argument is optional
- returns a list of tasks
/run
POST- run a task command
/tasks
POST- creating a new task command
/task/{id}
DELETE- remove an existing task
/task/{id}
GET- returns a task status
/task/{id}
PUT- updates an existing task