base

module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: AGPL-3.0

README

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

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)
	}
}

Directories

Path Synopsis
Package arr contains functions to interact with arrays.
Package arr contains functions to interact with arrays.
Package crypto contains functions to interact with cryptography.
Package crypto contains functions to interact with cryptography.
chacha20poly1305
Package chacha20poly1305 provides ChaCha20-Poly1305 encryption and decryption functions.
Package chacha20poly1305 provides ChaCha20-Poly1305 encryption and decryption functions.
Package database contains functions to interact with the database.
Package database contains functions to interact with the database.
Package env contains functions to interact with environment variables.
Package env contains functions to interact with environment variables.
Package errs contains functions to interact with errors.
Package errs contains functions to interact with errors.
Package qr contains functions to interact with QR codes.
Package qr contains functions to interact with QR codes.
Package vld contains functions to interact with validators.
Package vld contains functions to interact with validators.

Jump to

Keyboard shortcuts

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