slark

package module
v0.0.0-...-4cefd37 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: GPL-3.0 Imports: 13 Imported by: 0

README

Slark

Slark is an admin panel like django-admin built for Go.

Slark makes it easy to quickly manage your web app models and save time focusing on your product instead of consuming time to write a control panel.

struct UserModel {
    ID string
    Name string
}

struct TagModel {
    ID string
    Title string
}

struct PostModel {
    ID string
    Title string
    Content string
    Author UserModel `relation:belongsTo`
    Tags []TagModel `relation:hasMany`
}

Slark.Register(UserModel)

Slark.Register(PostModel)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(w http.ResponseWriter, r *http.Request)

Handle handles http requests

func Register

func Register(model interface{}, table string)

Register registers a given model to slark

Types

type Config

type Config struct {
	Route              string `yaml:"route"`
	DBConnectionString string `yaml:"db_connection_string"`
	DBDriver           string `yaml:"db_driver"`
}

type Field

type Field struct {
	Name   string
	DBType string
}

type Model

type Model struct {
	Name          string
	TableName     string
	Fields        []Field
	OriginalModel interface{}
	Reflection    reflect.Type
}

Jump to

Keyboard shortcuts

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