kocli

command module
v0.0.0-...-9196c9a Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 5 Imported by: 0

README

kocli

cli for knockout app

Install

go install github.com/woocoos/kocli
knockout

generate a knockout project in current directory:

kocli init -p github.com/woocoos/helloworld

or go get kocli and go run the script

go run github.com/woocoos/kocli/script/initproject/main.go

in codegen directory, scripts use //go:build ignore to keep ent generate run correctly, it can ignore build failure when your code is not ready and has some errors.

application data
resource

generate app resource info from ent schema, before run this you need go mod tidy first.

note: a knockout project usually uses a relative path based on project root,so you need to run this command in your project root directory.

# -a app code,need match your AppCode stored in Knockout application
# -f knockout.yaml is the portal config file which contains the portal db config and snowflake config.
# -e resource is ent schema path
kocli res ent -a resource -e ./ent/schema -f knockout.yaml
action

generate app action info from graphql file.

# -a and -f same as above 
# -g 99design/gqlgen config file path
kocli res gql-action -a resource -g gqlgen.yaml -f knockout.yaml
menu

generate app menu info from web menu data.

# -a and -f same as above
# -d web menu data path
kocli res web-menu -a resource -d ./web/menu.json -f knockout.yaml

menu data example:

[
  {
    "name": "home",
    "icon": "home",
    "children": [
      {
        "name": "dashboard",
        "icon": "dashboard",
        "path": "/dashboard"
      }
    ]
  }
]
  1. path will be auto generator an action.
  2. children will be generated as a menu dir.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
integration module
script
gqltools
GqlInOne is a tool to merge all gqlgen schema files into one file
GqlInOne is a tool to merge all gqlgen schema files into one file

Jump to

Keyboard shortcuts

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