Skip to content

Commit

Permalink
Merge pull request #4 from binary132/dev-version
Browse files Browse the repository at this point in the history
Add version to GET /source (rest.SourceInfo)
  • Loading branch information
binary132 authored Mar 26, 2017
2 parents a53c6c9 + b00ecf6 commit a17a3e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions rest/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import (
"encoding/json"
"net/http"

"github.com/synapse-garden/sg-proto/store"

htr "github.com/julienschmidt/httprouter"
)

// SourceInfo represents the SG-Proto source location and license, and
// implements API.
type SourceInfo struct {
License string `json:"license"`
LicensedTo string `json:"licensedTo"`
Location string `json:"location"`
Version store.Version `json:"version"`
License string `json:"license"`
LicensedTo string `json:"licensedTo"`
Location string `json:"location"`
}

// Bind implements API.Bind on SourceInfo.
Expand Down
6 changes: 4 additions & 2 deletions sg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"flag"
"log"

uuid "github.com/satori/go.uuid"
"github.com/synapse-garden/sg-proto/auth"
"github.com/synapse-garden/sg-proto/rest"
"github.com/synapse-garden/sg-proto/store"

"github.com/boltdb/bolt"
uuid "github.com/satori/go.uuid"
)

// CLI flags
Expand All @@ -34,7 +35,7 @@ var (
// Source constants
const (
SourceLicense = "Affero GPL V3"
Licensee = "SynapseGarden 2016"
Licensee = "SynapseGarden 2017"
)

func main() {
Expand All @@ -46,6 +47,7 @@ func main() {
}

source := rest.SourceInfo{
Version: store.VerCurrent,
Location: *SourceLocation,
License: SourceLicense,
LicensedTo: Licensee,
Expand Down

0 comments on commit a17a3e0

Please sign in to comment.