feat: move all lua api into api module
This commit is contained in:
parent
d65884b182
commit
294902970d
3 changed files with 41 additions and 29 deletions
26
lua/gopher/api.lua
Normal file
26
lua/gopher/api.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
local API = {}
|
||||
local tags = require "gopher.struct_tags"
|
||||
local tests = require "gopher.gotests"
|
||||
local cmd = require "gopher._utils.commands"
|
||||
|
||||
API.install_deps = require "gopher.installer"
|
||||
API.tags_add = tags.add
|
||||
API.tags_rm = tags.remove
|
||||
API.impl = require "gopher.impl"
|
||||
API.iferr = require "gopher.iferr"
|
||||
API.comment = require "gopher.comment"
|
||||
API.test_add = tests.func_test
|
||||
API.test_exported = tests.all_exported_tests
|
||||
API.tests_all = tests.all_tests
|
||||
|
||||
API.get = function(...)
|
||||
cmd("get", ...)
|
||||
end
|
||||
API.mod = function(...)
|
||||
cmd("mod", ...)
|
||||
end
|
||||
API.generate = function(...)
|
||||
cmd("generate", ...)
|
||||
end
|
||||
|
||||
return API
|
||||
|
|
@ -1,19 +1,5 @@
|
|||
local tags = require "gopher.struct_tags"
|
||||
local gotests = require "gopher.gotests"
|
||||
local gopher = {}
|
||||
local GOPHER = {}
|
||||
|
||||
gopher.install_deps = require "gopher.installer"
|
||||
gopher.tags_add = tags.add
|
||||
gopher.tags_rm = tags.remove
|
||||
gopher.mod = require "gopher.gomod"
|
||||
gopher.get = require "gopher.goget"
|
||||
gopher.impl = require "gopher.impl"
|
||||
gopher.generate = require "gopher.gogenerate"
|
||||
gopher.iferr = require "gopher.iferr"
|
||||
gopher.comment = require "gopher.comment"
|
||||
gopher.test_add = gotests.func_test
|
||||
gopher.test_exported = gotests.all_exported_tests
|
||||
gopher.tests_all = gotests.all_tests
|
||||
gopher.setup = require("gopher.config").setup
|
||||
GOPHER.setup = require("gopher.config").setup
|
||||
|
||||
return gopher
|
||||
return GOPHER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue