Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vereign Client Library
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Vereign Client Library
Commits
31e242a8
Commit
31e242a8
authored
6 years ago
by
Markin Igor
Browse files
Options
Downloads
Patches
Plain Diff
Get rid of unused stuff. Set up makefile to build and execute built app.
parent
60275101
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Use webpack for bundling JS libs and move Golang code related to Iframe generation there
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Gopkg.lock
+364
-1
364 additions, 1 deletion
Gopkg.lock
Gopkg.toml
+4
-0
4 additions, 0 deletions
Gopkg.toml
Makefile
+17
-1
17 additions, 1 deletion
Makefile
main.go
+13
-22
13 additions, 22 deletions
main.go
types/endpoints.go
+0
-14
0 additions, 14 deletions
types/endpoints.go
with
398 additions
and
38 deletions
Gopkg.lock
+
364
−
1
View file @
31e242a8
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "feature-move-js-libs-generation-to-separate-repo"
digest = "1:5d4ee872a90721b9405d67ad73dcf1efa6b93682b8a597aabebd2e2549499aff"
name = "code.vereign.com/code/restful-api"
packages = ["server"]
pruneopts = "UT"
revision = "f915d020bc78efd010424bc075513c40d4faa45a"
[[projects]]
branch = "master"
digest = "1:5f4044de57717046160c702b972ac28357fd0710319d83f6b20431df07795405"
name = "code.vereign.com/code/viam-apis"
packages = [
"authentication",
"connections",
"data-storage-agent/api",
"data-storage-agent/client",
"entities-management-agent/api",
"entities-management-agent/client",
"hyperledger-agent/api",
"hyperledger-agent/client",
"key-storage-agent/api",
"key-storage-agent/client",
"object-storage-agent/api",
"object-storage-agent/client",
"passport-generation-agent/api",
"passport-generation-agent/client",
"restful-api/api",
"signing-service-agent/api",
"signing-service-agent/client",
"smtp-agent/api",
"smtp-agent/client",
"utils",
"versions",
]
pruneopts = "UT"
revision = "90b379bf83b236ff9e8defcf758120e2049415b9"
[[projects]]
digest = "1:7b94d37d65c0445053c6f3e73090e3966c1c29127035492c349e14f25c440359"
name = "github.com/boombuler/barcode"
packages = [
".",
"qr",
"utils",
]
pruneopts = "UT"
revision = "3cfea5ab600ae37946be2b763b8ec2c1cf2d272d"
version = "v1.0.0"
[[projects]]
branch = "master"
digest = "1:bd513353bb48708852104393af519a24935ab28f477a65cb78a9086f6dd6b22f"
name = "github.com/fogleman/gg"
packages = ["."]
pruneopts = "UT"
revision = "0e0ff3ade7039063fe954cc1b45fad6cd4ac80db"
[[projects]]
digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd"
name = "github.com/fsnotify/fsnotify"
packages = ["."]
pruneopts = "UT"
revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9"
version = "v1.4.7"
[[projects]]
digest = "1:adea5a94903eb4384abef30f3d878dc9ff6b6b5b0722da25b82e5169216dfb61"
name = "github.com/go-sql-driver/mysql"
packages = ["."]
pruneopts = "UT"
revision = "d523deb1b23d913de5bdada721a6071e71283618"
version = "v1.4.0"
[[projects]]
digest = "1:bbadccf3d3317ea03c0dac0b45b673b4b397c8f91a1d2eff550a3c51c4ad770e"
name = "github.com/gogo/protobuf"
packages = ["proto"]
pruneopts = "UT"
revision = "636bf0302bc95575d69441b25a2603156ffdddf1"
version = "v1.1.1"
[[projects]]
branch = "master"
digest = "1:62c57507df491b657e9ae2645f30958d9964c8eeb380600469eedc951ebb3a0e"
name = "github.com/golang/freetype"
packages = [
"raster",
"truetype",
]
pruneopts = "UT"
revision = "e2365dfdc4a05e4b8299a783240d4a7d5a65d4e4"
[[projects]]
digest = "1:fa5e9e1af8a8645086811ec5ab003806026babc57c8bb3a6f7e1ab34b80e2ff1"
name = "github.com/golang/protobuf"
packages = [
"jsonpb",
"proto",
"protoc-gen-go/descriptor",
"ptypes",
"ptypes/any",
"ptypes/duration",
"ptypes/struct",
"ptypes/timestamp",
]
pruneopts = "UT"
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"
version = "v1.2.0"
[[projects]]
digest = "1:3cbc83a159e161c6cf3e64590ae19da29069ecd8d92f9400ab6fda15e93cbc5f"
name = "github.com/grpc-ecosystem/grpc-gateway"
packages = [
"runtime",
"runtime/internal",
"utilities",
]
pruneopts = "UT"
revision = "aeab1d96e0f1368d243e2e5f526aa29d495517bb"
version = "v1.5.1"
[[projects]]
digest = "1:c0d19ab64b32ce9fe5cf4ddceba78d5bc9807f0016db6b1183599da3dcc24d10"
name = "github.com/hashicorp/hcl"
packages = [
".",
"hcl/ast",
"hcl/parser",
"hcl/printer",
"hcl/scanner",
"hcl/strconv",
"hcl/token",
"json/parser",
"json/scanner",
"json/token",
]
pruneopts = "UT"
revision = "8cb6e5b959231cc1119e43259c4a608f9c51a241"
version = "v1.0.0"
[[projects]]
digest = "1:c568d7727aa262c32bdf8a3f7db83614f7af0ed661474b24588de635c20024c7"
name = "github.com/magiconair/properties"
packages = ["."]
pruneopts = "UT"
revision = "c2353362d570a7bfa228149c62842019201cfb71"
version = "v1.8.0"
[[projects]]
digest = "1:53bc4cd4914cd7cd52139990d5170d6dc99067ae31c56530621b18b35fc30318"
name = "github.com/mitchellh/mapstructure"
packages = ["."]
pruneopts = "UT"
revision = "3536a929edddb9a5b34bd6861dc4a9647cb459fe"
version = "v1.1.2"
[[projects]]
digest = "1:95741de3af260a92cc5c7f3f3061e85273f5a81b5db20d4bd68da74bd521675e"
name = "github.com/pelletier/go-toml"
packages = ["."]
pruneopts = "UT"
revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194"
version = "v1.2.0"
[[projects]]
digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747"
name = "github.com/pkg/errors"
packages = ["."]
pruneopts = "UT"
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
digest = "1:6c7a3f738e37a1c7ad3d56122a34932140654d51a57e01f8613cdf3eaf050911"
name = "github.com/pquerna/otp"
packages = [
".",
"hotp",
"totp",
]
pruneopts = "UT"
revision = "b7b89250c468c06871d3837bee02e2d5c155ae19"
version = "v1.0.0"
[[projects]]
digest = "1:6a4a11ba764a56d2758899ec6f3848d24698d48442ebce85ee7a3f63284526cd"
name = "github.com/spf13/afero"
packages = [
".",
"mem",
]
pruneopts = "UT"
revision = "d40851caa0d747393da1ffb28f7f9d8b4eeffebd"
version = "v1.1.2"
[[projects]]
digest = "1:08d65904057412fc0270fc4812a1c90c594186819243160dc779a402d4b6d0bc"
name = "github.com/spf13/cast"
packages = ["."]
pruneopts = "UT"
revision = "8c9545af88b134710ab1cd196795e7f2388358d7"
version = "v1.3.0"
[[projects]]
digest = "1:68ea4e23713989dc20b1bded5d9da2c5f9be14ff9885beef481848edd18c26cb"
name = "github.com/spf13/jwalterweatherman"
packages = ["."]
pruneopts = "UT"
revision = "4a4406e478ca629068e7768fc33f3f044173c0a6"
version = "v1.0.0"
[[projects]]
digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2"
name = "github.com/spf13/pflag"
packages = ["."]
pruneopts = "UT"
revision = "298182f68c66c05229eb03ac171abe6e309ee79a"
version = "v1.0.3"
[[projects]]
digest = "1:214775c11fd26da94a100111a62daa25339198a4f9c57cb4aab352da889f5b93"
name = "github.com/spf13/viper"
packages = ["."]
pruneopts = "UT"
revision = "2c12c60302a5a0e62ee102ca9bc996277c2f64f5"
version = "v1.2.1"
[[projects]]
branch = "master"
digest = "1:1ecf2a49df33be51e757d0033d5d51d5f784f35f68e5a38f797b2d3f03357d71"
name = "golang.org/x/crypto"
packages = [
"bcrypt",
"blowfish",
]
pruneopts = "UT"
revision = "e4dc69e5b2fd71dcaf8bd5d054eb936deb78d1fa"
[[projects]]
branch = "master"
digest = "1:c1a51e0afd2452a4156bc404f1e71c56cf7fe57ae8552cf0404cd3c880f77fd3"
name = "golang.org/x/image"
packages = [
"draw",
"font",
"font/basicfont",
"font/plan9font",
"math/f64",
"math/fixed",
]
pruneopts = "UT"
revision = "fe2fa19765cb86b31715edc83a4ee5fc5baedf89"
[[projects]]
branch = "master"
digest = "1:edb6e15d08296b91f0cd5b8b24d3778e122258e38493cb576094aa4764f3c826"
name = "golang.org/x/net"
packages = [
"context",
"http/httpguts",
"http2",
"http2/hpack",
"idna",
"internal/timeseries",
"trace",
]
pruneopts = "UT"
revision = "10aee181995363b41f712a55844a0dd52ea04646"
[[projects]]
branch = "master"
digest = "1:e2503f590982f6c0cc06abd7b94b17ded6804bada8eb79af753b5fb676dfdecc"
name = "golang.org/x/sys"
packages = ["unix"]
pruneopts = "UT"
revision = "3a76605856fddce5718553cbb8bd50ca492a7274"
[[projects]]
digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18"
name = "golang.org/x/text"
packages = [
"collate",
"collate/build",
"internal/colltab",
"internal/gen",
"internal/tag",
"internal/triegen",
"internal/ucd",
"language",
"secure/bidirule",
"transform",
"unicode/bidi",
"unicode/cldr",
"unicode/norm",
"unicode/rangetable",
]
pruneopts = "UT"
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
version = "v0.3.0"
[[projects]]
digest = "1:c25289f43ac4a68d88b02245742347c94f1e108c534dda442188015ff80669b3"
name = "google.golang.org/appengine"
packages = ["cloudsql"]
pruneopts = "UT"
revision = "4a4468ece617fc8205e99368fa2200e9d1fad421"
version = "v1.3.0"
[[projects]]
branch = "master"
digest = "1:ec1919b8b80839559effbe3eabcebf92238d12d3dd9182e51deb5da3ed12e5e9"
name = "google.golang.org/genproto"
packages = [
"googleapis/api/annotations",
"googleapis/rpc/status",
]
pruneopts = "UT"
revision = "c830210a61dfaa790e1920f8d0470fc27bc2efbe"
[[projects]]
digest = "1:c3ad9841823db6da420a5625b367913b4ff54bbe60e8e3c98bd20e243e62e2d2"
name = "google.golang.org/grpc"
packages = [
".",
"balancer",
"balancer/base",
"balancer/roundrobin",
"codes",
"connectivity",
"credentials",
"encoding",
"encoding/proto",
"grpclog",
"internal",
"internal/backoff",
"internal/channelz",
"internal/envconfig",
"internal/grpcrand",
"internal/transport",
"keepalive",
"metadata",
"naming",
"peer",
"resolver",
"resolver/dns",
"resolver/passthrough",
"stats",
"status",
"tap",
]
pruneopts = "UT"
revision = "2e463a05d100327ca47ac218281906921038fd95"
version = "v1.16.0"
[[projects]]
digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202"
name = "gopkg.in/yaml.v2"
packages = ["."]
pruneopts = "UT"
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
version = "v2.2.1"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
input-imports = []
input-imports = [
"code.vereign.com/code/restful-api/server"
]
solver-name = "gps-cdcl"
solver-version = 1
This diff is collapsed.
Click to expand it.
Gopkg.toml
+
4
−
0
View file @
31e242a8
...
...
@@ -24,6 +24,10 @@
# go-tests = true
# unused-packages = true
[[constraint]]
branch
=
"feature-move-js-libs-generation-to-separate-repo"
name
=
"code.vereign.com/code/restful-api"
[prune]
go-tests
=
true
unused-packages
=
true
This diff is collapsed.
Click to expand it.
Makefile
+
17
−
1
View file @
31e242a8
SERVER_OUT
:=
"bin/app"
PKG
:=
"code.vereign.com/code/vcl"
SERVER_PKG_BUILD
:=
"
${
PKG
}
"
.PHONY
:
all build clean run
all
:
build run
dep
:
##
Get the dependencies
dep ensure
cd
javascript
&&
yarn
install
&&
yarn build
build
:
dep
##
Build the binary file for app
@
go build
-i
-v
-o
$(
SERVER_OUT
)
$(
SERVER_PKG_BUILD
)
clean
:
##
Remove previous builds
@
rm
$(
SERVER_OUT
)
help
:
##
Display this help screen
@
grep
-E
'^[a-zA-Z_-]+:.*?## .*$$'
$(
MAKEFILE_LIST
)
|
sort
|
awk
'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
run
:
build
##
Run app
./bin/app
fresh
:
rm
-rf
./vendor
rm
-rf
./Gopkg.lock
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main.go
+
13
−
22
View file @
31e242a8
package
jslibs
package
main
import
(
"bytes"
"code.vereign.com/code/
vcl/types
"
"code.vereign.com/code/
restful-api/server
"
"fmt"
"io/ioutil"
"path/filepath"
"reflect"
"sort"
"strings"
...
...
@@ -13,23 +12,15 @@ import (
"unicode/utf8"
)
func
GetClientJsLibrary
(
iframeUrl
string
)
string
{
path
,
err
:=
filepath
.
Abs
(
"../vcl/javascript/dist/viamapi-client.js"
)
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
}
dat
,
err
:=
ioutil
.
ReadFile
(
path
)
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
}
return
strings
.
Replace
(
string
(
dat
),
"{{urlArg}}"
,
iframeUrl
,
1
)
+
"
\n
"
func
main
()
{
iframeLibrary
:=
buildIframeLibrary
()
fmt
.
Print
(
iframeLibrary
)
}
func
GetIframeJsLibrary
(
endPoints
map
[
string
]
*
types
.
EndPoint
)
string
{
func
buildIframeLibrary
()
string
{
prefixes
:=
[]
string
{}
endPoints
:=
server
.
GetEndPoints
(
prefixes
)
result
:=
"<script>
\n\n
"
var
keys
[]
string
...
...
@@ -41,7 +32,7 @@ func GetIframeJsLibrary(endPoints map[string]*types.EndPoint) string {
keysLen
:=
len
(
keys
)
dat
,
err
:=
ioutil
.
ReadFile
(
".
./vcl
/javascript/
dist
/viamapi-iframe.js"
)
dat
,
err
:=
ioutil
.
ReadFile
(
"./javascript/
src
/viamapi-iframe.js"
)
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
...
...
@@ -58,7 +49,7 @@ func GetIframeJsLibrary(endPoints map[string]*types.EndPoint) string {
result
+=
viamApi
+
"
\n\n
"
dat
,
err
=
ioutil
.
ReadFile
(
".
./vcl
/javascript/
dist
/wopiapi-iframe.js"
)
dat
,
err
=
ioutil
.
ReadFile
(
"./javascript/
src
/wopiapi-iframe.js"
)
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
...
...
@@ -153,7 +144,7 @@ func GetIframeJsLibrary(endPoints map[string]*types.EndPoint) string {
}
}
result
+=
"
\n\n
</script>"
result
+=
"</script>
\n
"
return
result
}
...
...
@@ -568,7 +559,7 @@ func dominantField(fields []field) (field, bool) {
return
fields
[
0
],
true
}
func
generatePenpalRemoteMethods
(
endPoints
map
[
string
]
*
types
.
EndPoint
)
string
{
func
generatePenpalRemoteMethods
(
endPoints
map
[
string
]
*
server
.
EndPoint
)
string
{
var
keys
[]
string
for
k
:=
range
endPoints
{
keys
=
append
(
keys
,
k
)
...
...
This diff is collapsed.
Click to expand it.
types/endpoints.go
deleted
100644 → 0
+
0
−
14
View file @
60275101
package
types
import
"net/http"
// TODO: this type rather belongs to restful-api, but we have to declare it there and use in restful-api as dependency. Move to separate repository in the future.
type
EndPoint
struct
{
Url
string
Prefixes
[]
string
HandlerType
string
Form
interface
{}
ManuallyWritten
bool
Handler
func
(
http
.
ResponseWriter
,
*
http
.
Request
)
DoNotIntercept
bool
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment