mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-13 09:12:43 +08:00
Change import statements accordingly
This commit is contained in:
parent
bcf0c5cb4c
commit
24f8c9fc62
@ -4,9 +4,9 @@ FROM golang:1.7
|
|||||||
COPY Dockerfile.run /go/bin/Dockerfile
|
COPY Dockerfile.run /go/bin/Dockerfile
|
||||||
COPY ./www /go/bin/www
|
COPY ./www /go/bin/www
|
||||||
|
|
||||||
COPY . /go/src/github.com/franela/play-with-docker
|
COPY . /go/src/github.com/play-with-docker/play-with-docker
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/franela/play-with-docker
|
WORKDIR /go/src/github.com/play-with-docker/play-with-docker
|
||||||
|
|
||||||
RUN go get -v -d ./...
|
RUN go get -v -d ./...
|
||||||
|
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2016 franela
|
Copyright (c) 2016 Marcos Lilljedhal and Jonathan Leibiusky
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
10
api.go
10
api.go
@ -10,13 +10,13 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/config"
|
|
||||||
"github.com/franela/play-with-docker/handlers"
|
|
||||||
"github.com/franela/play-with-docker/services"
|
|
||||||
"github.com/franela/play-with-docker/templates"
|
|
||||||
gh "github.com/gorilla/handlers"
|
gh "github.com/gorilla/handlers"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
|
"github.com/play-with-docker/play-with-docker/config"
|
||||||
|
"github.com/play-with-docker/play-with-docker/handlers"
|
||||||
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
|
"github.com/play-with-docker/play-with-docker/templates"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
"github.com/urfave/negroni"
|
"github.com/urfave/negroni"
|
||||||
)
|
)
|
||||||
@ -219,5 +219,3 @@ func handleDnsRequest(w dns.ResponseWriter, r *dns.Msg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ services:
|
|||||||
# use the latest golang image
|
# use the latest golang image
|
||||||
image: golang
|
image: golang
|
||||||
# go to the right place and starts the app
|
# go to the right place and starts the app
|
||||||
command: /bin/sh -c 'cd /go/src/github.com/franela/play-with-docker; go run api.go -save ./pwd/sessions1 -name pwd1 -cname host1'
|
command: /bin/sh -c 'cd /go/src/github.com/play-with-docker/play-with-docker; go run api.go -save ./pwd/sessions1 -name pwd1 -cname host1'
|
||||||
volumes:
|
volumes:
|
||||||
# since this app creates networks and launches containers, we need to talk to docker daemon
|
# since this app creates networks and launches containers, we need to talk to docker daemon
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
@ -29,7 +29,7 @@ services:
|
|||||||
# use the latest golang image
|
# use the latest golang image
|
||||||
image: golang
|
image: golang
|
||||||
# go to the right place and starts the app
|
# go to the right place and starts the app
|
||||||
command: /bin/sh -c 'cd /go/src/github.com/franela/play-with-docker; go run api.go -save ./pwd/sessions2 -name pwd2 -cname host2'
|
command: /bin/sh -c 'cd /go/src/github.com/play-with-docker/play-with-docker; go run api.go -save ./pwd/sessions2 -name pwd2 -cname host2'
|
||||||
volumes:
|
volumes:
|
||||||
# since this app creates networks and launches containers, we need to talk to docker daemon
|
# since this app creates networks and launches containers, we need to talk to docker daemon
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
@ -3,8 +3,8 @@ package handlers
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/services"
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
func DeleteInstance(rw http.ResponseWriter, req *http.Request) {
|
func DeleteInstance(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -4,11 +4,10 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/services"
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetInstanceImages(rw http.ResponseWriter, req *http.Request) {
|
func GetInstanceImages(rw http.ResponseWriter, req *http.Request) {
|
||||||
instanceImages := services.InstanceImages()
|
instanceImages := services.InstanceImages()
|
||||||
json.NewEncoder(rw).Encode(instanceImages)
|
json.NewEncoder(rw).Encode(instanceImages)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/services"
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetSession(rw http.ResponseWriter, req *http.Request) {
|
func GetSession(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/services"
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewInstance(rw http.ResponseWriter, req *http.Request) {
|
func NewInstance(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/config"
|
"github.com/play-with-docker/play-with-docker/config"
|
||||||
"github.com/franela/play-with-docker/services"
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NewSessionResponse struct {
|
type NewSessionResponse struct {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/config"
|
"github.com/play-with-docker/play-with-docker/config"
|
||||||
"github.com/shirou/gopsutil/load"
|
"github.com/shirou/gopsutil/load"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/config"
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/play-with-docker/play-with-docker/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getTargetInfo(vars map[string]string, req *http.Request) (string, string) {
|
func getTargetInfo(vars map[string]string, req *http.Request) (string, string) {
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/services"
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SetKeys(rw http.ResponseWriter, req *http.Request) {
|
func SetKeys(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/services"
|
|
||||||
"github.com/googollee/go-socket.io"
|
"github.com/googollee/go-socket.io"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
func WS(so socketio.Socket) {
|
func WS(so socketio.Socket) {
|
||||||
|
@ -10,8 +10,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/config"
|
|
||||||
"github.com/gorilla/securecookie"
|
"github.com/gorilla/securecookie"
|
||||||
|
"github.com/play-with-docker/play-with-docker/config"
|
||||||
"github.com/twinj/uuid"
|
"github.com/twinj/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
"github.com/docker/docker/api"
|
"github.com/docker/docker/api"
|
||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
"github.com/franela/play-with-docker/config"
|
|
||||||
"github.com/googollee/go-socket.io"
|
"github.com/googollee/go-socket.io"
|
||||||
|
"github.com/play-with-docker/play-with-docker/config"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/twinj/uuid"
|
"github.com/twinj/uuid"
|
||||||
)
|
)
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"html/template"
|
"html/template"
|
||||||
|
|
||||||
"github.com/franela/play-with-docker/services"
|
"github.com/play-with-docker/play-with-docker/services"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetWelcomeTemplate() ([]byte, error) {
|
func GetWelcomeTemplate() ([]byte, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user