Skip to content

Commit

Permalink
Update to use swagger-0.25 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Nov 18, 2020
1 parent f5cff6a commit 13577cd
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 59 deletions.
4 changes: 2 additions & 2 deletions cmd/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const (
)

type EventEmitter struct {
client *machine.Client
client machine.ClientService
machineID string
}

func NewEventEmitter(client *machine.Client, machineID string) *EventEmitter {
func NewEventEmitter(client machine.ClientService, machineID string) *EventEmitter {
emitter := &EventEmitter{
client: client,
machineID: machineID,
Expand Down
2 changes: 1 addition & 1 deletion cmd/event/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestNewEventEmitter(t *testing.T) {
client := machine.New(transport, strfmt.Default)

type args struct {
client *machine.Client
client machine.ClientService
machineID string
}
tests := []struct {
Expand Down
5 changes: 3 additions & 2 deletions cmd/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"crypto/tls"
"crypto/x509"
"errors"
"time"

"github.com/metal-stack/metal-hammer/cmd/event"
"github.com/metal-stack/metal-hammer/metal-core/client/certs"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/keepalive"
"time"
)

type GrpcClient struct {
Expand All @@ -21,7 +22,7 @@ type GrpcClient struct {

// NewGrpcClient fetches the address and certificates from metal-core needed to communicate with metal-api via grpc,
// and returns a new grpc client that can be used to invoke all provided grpc endpoints.
func NewGrpcClient(certsClient *certs.Client, emitter *event.EventEmitter) (*GrpcClient, error) {
func NewGrpcClient(certsClient certs.ClientService, emitter *event.EventEmitter) (*GrpcClient, error) {
params := certs.NewGrpcClientCertParams()
resp, err := certsClient.GrpcClientCert(params)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/register/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
// Register the Machine
type Register struct {
MachineUUID string
Client *machine.Client
Client machine.ClientService
Network *network.Network
Hal hal.InBand
}
Expand Down Expand Up @@ -162,7 +162,7 @@ func (r *Register) ReadHardwareDetails() (*models.DomainMetalHammerRegisterMachi
if err != nil {
return nil, err
}
hw.IPMI = ipmiconfig
hw.Ipmi = ipmiconfig

board := r.Hal.Board()
b := board.BIOS
Expand Down
2 changes: 1 addition & 1 deletion cmd/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

type Report struct {
Client *machine.Client
Client machine.ClientService
ConsolePassword string
MachineUUID string
InstallError error
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
type Hammer struct {
Spec *Specification
Hal hal.InBand
Client *machine.Client
Client machine.ClientService
GrpcClient *GrpcClient
EventEmitter *event.EventEmitter
Disk storage.Disk
Expand Down
36 changes: 18 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ module github.com/metal-stack/metal-hammer
require (
github.com/beevik/ntp v0.3.0
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/frankban/quicktest v1.10.0 // indirect
github.com/go-openapi/errors v0.19.6
github.com/go-openapi/runtime v0.19.21
github.com/go-openapi/strfmt v0.19.5
github.com/go-openapi/swag v0.19.9
github.com/go-openapi/validate v0.19.10
github.com/google/gopacket v1.1.17
github.com/fatih/color v1.10.0 // indirect
github.com/frankban/quicktest v1.11.2 // indirect
github.com/go-openapi/errors v0.19.8
github.com/go-openapi/runtime v0.19.24
github.com/go-openapi/strfmt v0.19.11
github.com/go-openapi/swag v0.19.12
github.com/go-openapi/validate v0.19.14
github.com/google/gopacket v1.1.19
github.com/google/uuid v1.1.2
github.com/inconshreveable/log15 v0.0.0-20200109203555-b30bc20e4fd1
github.com/jaypipes/ghw v0.6.0
github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac
github.com/jaypipes/ghw v0.6.1
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7
github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5
github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065
github.com/metal-stack/go-hal v0.2.1
github.com/metal-stack/metal-api v0.10.2
github.com/metal-stack/metal-lib v0.6.3
github.com/metal-stack/go-hal v0.3.0
github.com/metal-stack/metal-api v0.11.1
github.com/metal-stack/metal-lib v0.6.6
github.com/metal-stack/v v1.0.2
// archiver must stay in version v2.1.0, see replace below
github.com/mholt/archiver v3.1.1+incompatible
Expand All @@ -29,14 +29,14 @@ require (
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.6.1
github.com/u-root/u-root v6.0.0+incompatible
github.com/vishvananda/netlink v1.0.0
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642
google.golang.org/grpc v1.31.0
github.com/vishvananda/netlink v1.1.0
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect
golang.org/x/sys v0.0.0-20201117222635-ba5294a509c7
google.golang.org/grpc v1.33.2
gopkg.in/cheggaaa/pb.v1 v1.0.28
gopkg.in/yaml.v2 v2.3.0
)

replace github.com/mholt/archiver => github.com/mholt/archiver v2.1.0+incompatible

go 1.13
go 1.15
Loading

0 comments on commit 13577cd

Please sign in to comment.