Skip to content

Commit

Permalink
Work on comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-myles committed Jun 10, 2024
1 parent 274f1ae commit e1bccf6
Show file tree
Hide file tree
Showing 25 changed files with 689 additions and 763 deletions.
2 changes: 1 addition & 1 deletion application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cmd/husky-bark:
version: local
defaultEndpointTimeout: 30s
httpServer:
port: 6443
port: 8443
certPath: cmd/husky-bark/.testdata/localhost.crt
keyPath: cmd/husky-bark/.testdata/localhost.key
wintr/auth/ice:
Expand Down
2 changes: 0 additions & 2 deletions cmd/husky-bark/.testdata/application.yaml

This file was deleted.

Empty file.
21 changes: 0 additions & 21 deletions cmd/husky-bark/.testdata/localhost.crt

This file was deleted.

28 changes: 0 additions & 28 deletions cmd/husky-bark/.testdata/localhost.key

This file was deleted.

41 changes: 0 additions & 41 deletions cmd/husky-bark/api/docs.go

This file was deleted.

17 changes: 0 additions & 17 deletions cmd/husky-bark/api/swagger.json

This file was deleted.

15 changes: 0 additions & 15 deletions cmd/husky-bark/api/swagger.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions cmd/husky-bark/contract.go

This file was deleted.

36 changes: 16 additions & 20 deletions cmd/husky-bark/husky_bark.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,44 @@ package main

import (
"context"
"fmt"

"github.com/pkg/errors"

"github.com/ice-blockchain/husky/cmd/husky-pack/api"
"github.com/ice-blockchain/husky/notifications"
appcfg "github.com/ice-blockchain/wintr/config"
"github.com/ice-blockchain/wintr/log"
"github.com/ice-blockchain/wintr/server"
)

// @title Notifications API
// @version latest
// @description API that handles everything related to write-only operations for notifying users about anything worthwhile.
// @query.collection.format multi
// @schemes https
// @contact.name ice.io
// @contact.url https://ice.io
// @BasePath /v1w
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

var cfg config
appcfg.MustLoadFromKey(applicationYamlKey, &cfg)
api.SwaggerInfo.Host = cfg.Host
api.SwaggerInfo.Version = cfg.Version
server.New(new(service), applicationYamlKey, swaggerRoot).ListenAndServe(ctx, cancel)
const pkgName = "cmd/husky-bark"

var cfg struct{ Version string }
appcfg.MustLoadFromKey(pkgName, &cfg)

log.Info(fmt.Sprintf("starting version `%v`...", cfg.Version))

server.New(new(service), pkgName, "").ListenAndServe(ctx, cancel)
}

type (
// | service implements server.State and is responsible for managing the state and lifecycle of the package.
service struct{ notificationsScheduler *notifications.Scheduler }
)

func (*service) RegisterRoutes(_ *server.Router) {
}

func (s *service) Init(ctx context.Context, _ context.CancelFunc) {
s.notificationsScheduler = notifications.MustStartScheduler(ctx)
}

func (s *service) Close(ctx context.Context) error {
if ctx.Err() != nil {
return errors.Wrap(ctx.Err(), "could not close processors because context ended")
}

return errors.Wrap(s.notificationsScheduler.Close(), "could not close notifications scheduler")
func (s *service) Close(_ context.Context) error {
return errors.Wrap(s.notificationsScheduler.Close(), "could not close service")
}

func (s *service) CheckHealth(ctx context.Context) error {
Expand Down
50 changes: 25 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ require (
github.com/goccy/go-json v0.10.3
github.com/google/uuid v1.6.0
github.com/hashicorp/go-multierror v1.1.1
github.com/ice-blockchain/eskimo v1.307.0
github.com/ice-blockchain/freezer v1.416.0
github.com/ice-blockchain/eskimo v1.314.0
github.com/ice-blockchain/freezer v1.423.0
github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb
github.com/ice-blockchain/wintr v1.136.0
github.com/ice-blockchain/wintr v1.138.0
github.com/imroc/req/v3 v3.43.7
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/swaggo/swag v1.16.3
github.com/testcontainers/testcontainers-go v0.31.0
golang.org/x/net v0.25.0
golang.org/x/net v0.26.0
)

require (
Expand All @@ -35,7 +35,7 @@ require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/MicahParks/keyfunc v1.9.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.3 // indirect
github.com/Microsoft/hcsshim v0.12.4 // indirect
github.com/alitto/pond v1.8.3 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
Expand All @@ -51,7 +51,7 @@ require (
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
github.com/containerd/containerd v1.7.17 // indirect
github.com/containerd/containerd v1.7.18 // indirect
github.com/containerd/continuity v0.4.3 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
Expand All @@ -61,11 +61,11 @@ require (
github.com/distribution/reference v0.6.0 // indirect
github.com/dmarkham/enumer v1.5.9 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v26.1.3+incompatible // indirect
github.com/docker/docker v26.1.4+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.2 // indirect
github.com/ethereum/go-ethereum v1.14.3 // indirect
github.com/ethereum/go-ethereum v1.14.5 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand Down Expand Up @@ -96,21 +96,21 @@ require (
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.4 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gorilla/websocket v1.5.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/ip2location/ip2location-go/v9 v9.7.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.6.0 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand All @@ -132,11 +132,11 @@ require (
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/quic-go v0.44.0 // indirect
github.com/redis/go-redis/v9 v9.5.2 // indirect
github.com/quic-go/quic-go v0.45.0 // indirect
github.com/redis/go-redis/v9 v9.5.3 // indirect
github.com/refraction-networking/utls v1.6.6 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.5.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/sendgrid/rest v2.6.9+incompatible // indirect
Expand Down Expand Up @@ -173,20 +173,20 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/api v0.182.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/api v0.183.0 // indirect
google.golang.org/appengine/v2 v2.0.6 // indirect
google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto v0.0.0-20240610135401-a8a62080eff3 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading

0 comments on commit e1bccf6

Please sign in to comment.