gowok

package module
v0.4.22 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 36 Imported by: 27

README

Gowok is a library that contains a lot of functions that help you to build Go project.

It has some utilities like:

  • config loader,
  • project bootstrapper,
  • HTTP response builder,
  • nil safety,
  • password hash, and so on.

Getting Started

Installation

Run this command inside your project.

go get github.com/gowok/gowok

Import in Project

In your main.go, write code like following example:

package main

import "github.com/gowok/gowok"

func main() {
	gowok.Get().Run()
}

Create Configuration

  1. Create a YAML file named config.yaml.
  2. Then write this.
web:
  enabled: true
  host: :8080

Running the Project

Run this command inside your project.

go run main.go

Or if config file not on root dir, use flag --config

go run main.go --config=folder/gowok.yaml

It will show output like this:

2025/01/13 10:43:09 INFO starting web

Your project now ready to use 🔥

Let's try to send a request using curl!

curl localhost:8080

It will show output like this:

404 page not found

It means that your project already run. It can receive actual request and give response to it.

How to Contribute

Feel free to raise an issue or lovely pull request 😊

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Async = &_async{}
View Source
var CMD = &_cmd{
	Command: &cobra.Command{},
}
View Source
var Config = &config.Config{}
View Source
var GRPC = _grpc{
	Server: grpc.NewServer(),
}
View Source
var Hash = _hash{}
View Source
var Health = _health{
	// contains filtered or unexported fields
}
View Source
var Hooks = &_hooks{&runtime.Hooks{}}
View Source
var SQL = _sql{
	// contains filtered or unexported fields
}
View Source
var Web = &_web{
	HttpServeMux: ngamux.NewHttpServeMux(),
	Server:       &http.Server{},
	Handler:      &_webHandler{},
}

Functions

func Configure added in v0.4.22

func Configure(configs ...config.Config)

func DD

func DD(input any) error

func Flags

func Flags() *flags

func Must added in v0.4.22

func Must[T any](res T, err error) T

func Run added in v0.3.94

func Run(config ...config.Config)

func ToPtr

func ToPtr[T any](v T) *T

Types

type ConfigureFunc

type ConfigureFunc func(*Project)

type Password added in v0.4.22

type Password struct {
	Hashed string
	Salt   string
}

type Project

type Project struct {
	// contains filtered or unexported fields
}

func Configures added in v0.3.94

func Configures(configures ...ConfigureFunc) *Project

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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