Skip to content

Commit 11ca52d

Browse files
committed
Update license, readme, and makefille
1 parent eacd864 commit 11ca52d

File tree

5 files changed

+102
-3
lines changed

5 files changed

+102
-3
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# vendor/
1616

1717
# Config files
18-
config/*.yml
18+
config/*.yml

LICENSE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2010-2021, The Arizona Board of Regents on behalf of The University of Arizona
2+
3+
All rights reserved.
4+
5+
Developed by: CyVerse as a collaboration between participants at BIO5 at The University of Arizona (the primary hosting institution), Cold Spring Harbor Laboratory, The University of Texas at Austin, and individual contributors. Find out more at http://www.cyverse.org/.
6+
7+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11+
* Neither the name of CyVerse, BIO5, The University of Arizona, Cold Spring Harbor Laboratory, The University of Texas at Austin, nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
PKG=github.com/cyverse/go-irodsclient
2+
VERSION=v0.1.0
3+
GIT_COMMIT?=$(shell git rev-parse HEAD)
4+
BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
5+
LDFLAGS?="-X ${PKG}/pkg/client.clientVersion=${VERSION} -X ${PKG}/pkg/client.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/client.buildDate=${BUILD_DATE}"
6+
GO111MODULE=on
7+
GOPROXY=direct
8+
GOPATH=$(shell go env GOPATH)
9+
10+
.EXPORT_ALL_VARIABLES:
11+
12+
#.PHONY: client
13+
#client:
14+
# mkdir -p bin
15+
# CGO_ENABLED=0 GOOS=linux go build -ldflags ${LDFLAGS} -o bin/go-irodsclient ./cmd/
16+
17+
.PHONY: test
18+
test:
19+
go test ./...

README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
# go-irodsclient
2-
Go iRODS Client
2+
Go iRODS Client implemented in pure Golang
33

44
## Testing
55
```shell script
66
go test -v ./...
7-
```
7+
```
8+
9+
## License
10+
11+
Copyright (c) 2010-2021, The Arizona Board of Regents on behalf of The University of Arizona
12+
13+
All rights reserved.
14+
15+
Developed by: CyVerse as a collaboration between participants at BIO5 at The University of Arizona (the primary hosting institution), Cold Spring Harbor Laboratory, The University of Texas at Austin, and individual contributors. Find out more at http://www.cyverse.org/.
16+
17+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
18+
19+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
20+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
21+
* Neither the name of CyVerse, BIO5, The University of Arizona, Cold Spring Harbor Laboratory, The University of Texas at Austin, nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
22+
23+
24+
Please check [LICENSE](https://github.com/cyverse/go-irodsclient/tree/master/LICENSE) file.

pkg/client/version.go

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package client
2+
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
"runtime"
7+
)
8+
9+
var (
10+
clientVersion string
11+
gitCommit string
12+
buildDate string
13+
)
14+
15+
// VersionInfo object contains version related info
16+
type VersionInfo struct {
17+
ClientVersion string `json:"clientVersion"`
18+
GitCommit string `json:"gitCommit"`
19+
BuildDate string `json:"buildDate"`
20+
GoVersion string `json:"goVersion"`
21+
Compiler string `json:"compiler"`
22+
Platform string `json:"platform"`
23+
}
24+
25+
// GetVersion returns VersionInfo object
26+
func GetVersion() VersionInfo {
27+
return VersionInfo{
28+
ClientVersion: clientVersion,
29+
GitCommit: gitCommit,
30+
BuildDate: buildDate,
31+
GoVersion: runtime.Version(),
32+
Compiler: runtime.Compiler,
33+
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
34+
}
35+
}
36+
37+
// GetClientVersion returns client version in string
38+
func GetClientVersion() string {
39+
return clientVersion
40+
}
41+
42+
// GetVersionJSON returns VersionInfo object in JSON string
43+
func GetVersionJSON() (string, error) {
44+
info := GetVersion()
45+
marshalled, err := json.MarshalIndent(&info, "", " ")
46+
if err != nil {
47+
return "", err
48+
}
49+
return string(marshalled), nil
50+
}

0 commit comments

Comments
 (0)