Skip to content

dracory/base

Repository files navigation

base Open in Gitpod

Tests Status Go Report Card PkgGoDev

License

This project is dual-licensed under the following terms:

  • For non-commercial use, you may choose either the GNU Affero General Public License v3.0 (AGPLv3) or a separate commercial license (see below). You can find a copy of the AGPLv3 at: https://www.gnu.org/licenses/agpl-3.0.txt

  • For commercial use, a separate commercial license is required. Commercial licenses are available for various use cases. Please contact me via my contact page to obtain a commercial license.

Installation

go get github.com/dracory/base

About Dracory

The Dracory project is a Go framework that provides various utilities, including:

  • BBCode to HTML conversion
  • Slice manipulation
  • Database interaction
  • Error handling and validation
  • Image manipulation
  • URL downloading
  • QR code generation
  • HTTP request handling
  • Timezone conversion
  • Date and datetime validation
  • Web server functionality
  • Command line functionality

Environment Variables

The Dracory framework provides easy access to environment variables using the env package.

For information on environment variables, see the env/README.md file.

Database

The database package provides database interaction functionalities for the Dracory framework. It offers a set of tools for interacting with various database systems.

For more information, see the database/README.md file.

Running a Web Server

Here's an example of how to run a web server using Dracory:

package main

import (
	"fmt"
	"net/http"

	"github.com/dracory/base/server"
)

func main() {
	// Define the handler function
	handler := func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintf(w, "Hello, Dracory!")
	}

	// Define the server options
	options := server.Options{
		Host:    "localhost",
		Port:    "8080",
		Handler: handler,
	}

	// Start the server
	_, err := server.Start(options)
	if err != nil {
		panic(err)
	}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages