less

command module
v0.0.0-...-af619fd Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 15 Imported by: 0

README

less

less is a web framework written in Go (Golang). less is more.

Installation

To install less package, you need to install Go and set your Go workspace first.

  1. You first need Go installed (version 1.16+ is required), then you can use the below Go command to install less.
$ go get -u https://github.com/BugKillerPro/less
  1. Import it in your code:
import "https://github.com/BugKillerPro/less"

Quick start

package main

import (
    "github.com/BugKillerPro/less/app/console"
    "github.com/BugKillerPro/less/app/http"
    "github.com/BugKillerPro/less/framework"
    "github.com/BugKillerPro/less/framework/provider/app"
    "github.com/BugKillerPro/less/framework/provider/kernel"
)

func main() {
    // 初始化服务容器
    container := framework.NewlessContainer()
    // 绑定App服务提供者
    container.Bind(&app.LessAppProvider{})

    // 将HTTP引擎初始化,并且作为服务提供者绑定到服务容器中
    if engine, err := http.NewHttpEngine(container); err == nil {
        container.Bind(&kernel.LessKernelProvider{HttpEngine: engine})
    }

    // 运行root命令
    console.RunCommand(container)
}

Documentation

Overview

Copyright 2021 bugkillerpro. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.

Directories

Path Synopsis
app
http/swagger
Package swagger GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
Package swagger GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
cobra
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
gin
Package gin implements a HTTP web framework called gin.
Package gin implements a HTTP web framework called gin.

Jump to

Keyboard shortcuts

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