wiki

package module
v0.0.0-...-a333e2e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: MIT Imports: 16 Imported by: 0

README

wiki

Example implementation of wiki.

How to run

go get github.com/suzuken/wiki/cmd/wiki
wiki

or

make run

Requirements

  • Go 1.7 or later
  • MySQL 5.6

Tips

Generate Scans

Using scaneo. Simply,

# edit models, and
make gen
DB

Use docker container. For database migration, sql-migrate

# Docker's MySQL build
make docker/build
make docker/start

# run migrate/up after adding ddl in migrations dir.
make migrate/up

Originally from gin-boilerplate

Author

Kenta SUZUKI a.k.a. suzuken

LICENSE

MIT

Documentation

Overview

Copyright 2017 The Go Authors. All rights reserved.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.

This handler implementation is based on gddo. https://github.com/golang/gddo/tree/master/gddo-server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(h handler) handler

Auth verify if session user is logged in.

func GET

func GET(h handler) handler

func POST

func POST(h handler) handler

Types

type Server

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

Server is whole server implementation for this wiki app. This holds database connection and router settings.

func New

func New() *Server

New returns server object.

func (*Server) Close

func (s *Server) Close() error

Close makes the database connection to close.

func (*Server) Init

func (s *Server) Init(dbconf, env string, debug bool)

Init initialize server state. Connecting to database, compiling templates, and settings router.

func (*Server) Route

func (s *Server) Route()

Route setting router for this wiki.

func (*Server) Run

func (s *Server) Run(addr string)

Run starts running http server.

Directories

Path Synopsis
cmd
originally from github.com/golang/gddo/httputil.(ResponseBuffer)
originally from github.com/golang/gddo/httputil.(ResponseBuffer)

Jump to

Keyboard shortcuts

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