diff --git a/Dockerfile b/Dockerfile index 95b3df0..74f0df4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ #FROM ubuntu:latest FROM golang:1.16.6-buster -WORKDIR /usr/src/app + RUN apt-get update RUN apt-get install -y make sudo nsis ca-certificates openssl RUN mkdir -p /go/src/github.com/ao-data/albiondata-client -COPY ./ /go/src/github.com/ao-data/albiondata-client - +RUN mkdir -p /go/src/github.com/ao-data/albiondata-client +WORKDIR /go/src/github.com/ao-data/albiondata-client +COPY . . diff --git a/client/operation_auction_get_item_average_stats.go b/client/operation_auction_get_item_average_stats.go index c72e793..f1934bb 100644 --- a/client/operation_auction_get_item_average_stats.go +++ b/client/operation_auction_get_item_average_stats.go @@ -5,7 +5,7 @@ import ( "github.com/ao-data/albiondata-client/lib" "github.com/ao-data/albiondata-client/log" - "github.com/google/uuid" + uuid "github.com/nu7hatch/gouuid" ) type operationAuctionGetItemAverageStats struct { @@ -89,7 +89,7 @@ func (op operationAuctionGetItemAverageStatsResponse) Process(state *albionState return histories[i].Timestamp > histories[j].Timestamp }) - identifier, _ := uuid.NewRandom() + identifier, _ := uuid.NewV4() upload := lib.MarketHistoriesUpload{ AlbionId: mhInfo.albionId, @@ -97,7 +97,7 @@ func (op operationAuctionGetItemAverageStatsResponse) Process(state *albionState QualityLevel: mhInfo.quality, Timescale: mhInfo.timescale, Histories: histories, - Identifier: identifier.String(), + Identifier: identifier.String(), } log.Infof("Sending %d market history item average stats to ingest for albionID %d (Identifier: %s)", len(histories), mhInfo.albionId, identifier) diff --git a/client/operation_auction_get_offers.go b/client/operation_auction_get_offers.go index 26320bb..2a0f06d 100644 --- a/client/operation_auction_get_offers.go +++ b/client/operation_auction_get_offers.go @@ -5,7 +5,7 @@ import ( "github.com/ao-data/albiondata-client/lib" "github.com/ao-data/albiondata-client/log" - "github.com/google/uuid" + uuid "github.com/nu7hatch/gouuid" ) type operationAuctionGetOffers struct { @@ -53,10 +53,10 @@ func (op operationAuctionGetOffersResponse) Process(state *albionState) { return } - identifier, _ := uuid.NewRandom() + identifier, _ := uuid.NewV4() upload := lib.MarketUpload{ - Orders: orders, + Orders: orders, Identifier: identifier.String(), } diff --git a/client/operation_auction_get_requests.go b/client/operation_auction_get_requests.go index 6ad4117..2132896 100644 --- a/client/operation_auction_get_requests.go +++ b/client/operation_auction_get_requests.go @@ -5,7 +5,7 @@ import ( "github.com/ao-data/albiondata-client/lib" "github.com/ao-data/albiondata-client/log" - "github.com/google/uuid" + uuid "github.com/nu7hatch/gouuid" ) type operationAuctionGetRequestsResponse struct { @@ -37,10 +37,10 @@ func (op operationAuctionGetRequestsResponse) Process(state *albionState) { return } - identifier, _ := uuid.NewRandom() + identifier, _ := uuid.NewV4() upload := lib.MarketUpload{ - Orders: orders, + Orders: orders, Identifier: identifier.String(), } diff --git a/client/operation_gold_market_get_average_info.go b/client/operation_gold_market_get_average_info.go index 8438ec4..0ca7e22 100644 --- a/client/operation_gold_market_get_average_info.go +++ b/client/operation_gold_market_get_average_info.go @@ -3,7 +3,7 @@ package client import ( "github.com/ao-data/albiondata-client/lib" "github.com/ao-data/albiondata-client/log" - "github.com/google/uuid" + uuid "github.com/nu7hatch/gouuid" ) type operationGoldMarketGetAverageInfo struct { @@ -21,7 +21,7 @@ type operationGoldMarketGetAverageInfoResponse struct { func (op operationGoldMarketGetAverageInfoResponse) Process(state *albionState) { log.Debug("Got response to GoldMarketGetAverageInfo operation...") - identifier, _ := uuid.NewRandom() + identifier, _ := uuid.NewV4() upload := lib.GoldPricesUpload{ Prices: op.GoldPrices, diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5fe5119 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.5" + +services: + builder: + # image: golang:1.16.6-buster + platform: linux/amd64 + build: + context: ./ + volumes: + - .:/go/src/github.com/ao-data/albiondata-client + stdin_open: true + tty: true + entrypoint: 'sleep infinity' + \ No newline at end of file diff --git a/go.mod b/go.mod index 58fadbe..07adc8f 100644 --- a/go.mod +++ b/go.mod @@ -23,13 +23,12 @@ require ( github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/getlantern/golog v0.0.0-20201022140317-a8d13dc71777 // indirect github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6 // indirect - github.com/google/uuid v1.6.0 github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/magiconair/properties v1.8.4 // indirect github.com/nats-io/gnatsd v1.4.1 // indirect github.com/nats-io/nkeys v0.2.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect - github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect + github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d github.com/pelletier/go-toml v1.8.1 // indirect github.com/spf13/afero v1.4.1 // indirect github.com/spf13/cast v1.3.1 // indirect diff --git a/go.sum b/go.sum index 246f411..61e5f88 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,6 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= diff --git a/scripts/build-windows.sh b/scripts/build-windows.sh index 1e1f3f7..cfa9371 100755 --- a/scripts/build-windows.sh +++ b/scripts/build-windows.sh @@ -13,6 +13,10 @@ go install github.com/tc-hib/go-winres@v0.3.1 export PATH="$PATH:/root/go/bin" +go mod init + +go mod download + go-winres make env GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=$GITHUB_REF_NAME" -o albiondata-client.exe -v -x albiondata-client.go