Golang Echo and html template.

Overview

golang-website-example

Golang Echo and html template.

move GitHub repository for hello to golang-website-example

Visual Studio Code

Run and Debug: launch.json.

Getting Started

First, clone the repo:

$ git clone https://github.com/ockibagusp/golang-website-example.git

Setting MySQL database

Database

file: golang-website-example.sql -> new database: golang-website-example

Testing

file: golang-website-example.sql -> new database: golang-website-example_test

User Tables

Username Password
ockibagusp user123
sugriwa user123
subali user123

Router

This using router.

httpexpect: Test for Debug

This using debug.

Optional. Default value @debug: {true} or {1}.

  1. function debug (bool)

    @function debug: {true} or {false}

  2. os.Setenv("debug", ...)

    • @debug: {true} or {1}

      os.Setenv("debug", "true") 
      

      or,

      os.Setenv("debug", "1")
      
    • @debug: {false} or {0}

      os.Setenv("debug", "false") 
      

      or,

      os.Setenv("debug", "0")
      

Running app

Compile and run Go program

$ go run main.go

or,

Build compiles the packages

$ go build
  • On Linux or Mac:

    $ ./golang-website-example
    
  • On Windows:

    $ golang-website-example.exe
    

Test the packages

$ go test github.com/ockibagusp/golang-website-example/test 

or, verbose output (-v) flag:

$ go test github.com/ockibagusp/golang-website-example/test -v

TODO List

  • mock unit test
  • session: IsAdmin, IsUser and IsAuth
  • list pagination with next, previous, first and last
  • Mutex: BankAccount
  • too much

Operating System (with me)

Linux:

  • Fedora 35 Workstation

Go:

  • go1.16.11 linux/amd64

MySQL:

  • mysql Ver 8.0.27 for Linux on x86_64 (Source distribution)

Bahasa Indonesia

Der Schlaganfall 03.10.2018-heute. Dirilis 7 Januari 2020. Coding ini sedikit lupa. Pun, ini Bahasa Inggris lupa lagi. Perlahan-lahan dari stroke. Aamiin.

English (translate[.]google[.]co[.]id)

Stroke: 03 10 2018-today. Released January 7, 2020. This coding is a little forgotten. This is English forgot again. Little by little from stroke. Aamiin.


Copyright © 2020 by Ocki Bagus Pratama

You might also like...
Templating system for HTML and other text documents - go implementation

FAQ What is Kasia.go? Kasia.go is a Go implementation of the Kasia templating system. Kasia is primarily designed for HTML, but you can use it for any

A strongly typed HTML templating language that compiles to Go code, and has great developer tooling.
A strongly typed HTML templating language that compiles to Go code, and has great developer tooling.

A language, command line tool and set of IDE extensions that makes it easier to write HTML user interfaces and websites using Go.

Safe HTML for Go

Safe HTML for Go safehtml provides immutable string-like types that wrap web types such as HTML, JavaScript and CSS. These wrappers are safe by constr

mold your templated to HTML/ TEXT/ PDF easily.
mold your templated to HTML/ TEXT/ PDF easily.

mold mold your templated to HTML/ TEXT/ PDF easily. install go get github.com/mayur-tolexo/mold Example 1 //Todo model type Todo struct { Title stri

A general purpose golang CLI template for Github and Gitlab

golang-cli-template A general purpose project template for golang CLI applications This template serves as a starting point for golang commandline app

A Go Template Library. A bunch of utils and collections that are not part of the Golang standard library.

gotl A Go Template Library. A bunch of utils and collections that are not part of the Golang standard library. Prerequisites This library is using ext

Clean arch Golang template project

Template No previous versions, still working on this one to reach v1. API Service for pssword app mobilde based on : https://github.com/bxcodec/go-cle

Template for Golang rest API using Fiber

Rest API Setup DB sudo -S docker-compose -f db.yml up -d Build container sudo -S docker build -t rest-api-image . Run container from image sudo -S doc

Clean Architecture template for Golang services
Clean Architecture template for Golang services

Go Clean template Clean Architecture template for Golang services Overview The purpose of the template is to show: how to organize a project and preve

Owner
Ocki Bagus Pratama
Half-blood. Code is poetry.
Ocki Bagus Pratama
Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.

goview Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application. Contents Inst

foolin 314 Dec 25, 2022
A template to build dynamic web apps quickly using Go, html/template and javascript

gomodest-template A modest template to build dynamic web apps in Go, HTML and sprinkles and spots of javascript. Why ? Build dynamic websites using th

Adnaan Badr 85 Dec 29, 2022
Wrapper package for Go's template/html to allow for easy file-based template inheritance.

Extemplate Extemplate is a small wrapper package around html/template to allow for easy file-based template inheritance. File: templates/parent.tmpl <

Danny van Kooten 51 Dec 6, 2022
Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

quicktemplate A fast, powerful, yet easy to use template engine for Go. Inspired by the Mako templates philosophy. Features Extremely fast. Templates

Aliaksandr Valialkin 2.7k Dec 26, 2022
Package damsel provides html outlining via css-selectors and common template functionality.

Damsel Markup language featuring html outlining via css-selectors, extensible via pkg html/template and others. Library This package expects to exist

Daniel Skinner 24 Oct 23, 2022
HTML template engine for Go

Ace - HTML template engine for Go Overview Ace is an HTML template engine for Go. This is inspired by Slim and Jade. This is a refinement of Gold. Exa

Keiji Yoshida 827 Jan 4, 2023
Go-project-template - Template for a golang project

This is a template repository for golang project Usage Go to github: https://git

KyberNetwork 4 Oct 25, 2022
Made from template temporalio/money-transfer-project-template-go

Temporal Go Project Template This is a simple project for demonstrating Temporal with the Go SDK. The full 20 minute guide is here: https://docs.tempo

MarkGorewicz 0 Jan 6, 2022
Go-api-template - A rough template to give you a starting point for your API

Golang API Template This is only a rough template to give you a starting point f

Only Tunes Radio 3 Jan 14, 2022
Api-go-template - A simple Go API template that uses a controller-service based model to build its routes

api-go-template This is a simple Go API template that uses a controller-service

Pedro Espíndula 1 Feb 18, 2022