Skip to content

Commit

Permalink
Fix creation of private struct
Browse files Browse the repository at this point in the history
  • Loading branch information
imjuanleonard committed Aug 30, 2019
1 parent 890509e commit eb47d84
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type config struct {
debugMode bool
port int
cacheTime int
source source
source CloudSource
enableConcurrentOpacityChecking bool
}

Expand All @@ -32,7 +32,7 @@ func newConfig() *config {
port = 3000 // Fallback to default port
}

s := source{
s := CloudSource{
Kind: v.GetString("source.kind"),
HystrixCommand: storage.HystrixCommand{
Name: v.GetString("source.hystrix.commandName"),
Expand Down Expand Up @@ -83,7 +83,7 @@ func CacheTime() int {
}

// Source returns the source struct after it is initialised from the environment values
func Source() *source {
func Source() *CloudSource {
return &getConfig().source
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Cloudfront struct {
SecureProtocol bool
}

type source struct {
type CloudSource struct {
// Kind tells which type of Storage backend should be used
Kind string
// HystrixCommand provides the hystrix config to be used with the source to add resiliency
Expand All @@ -43,7 +43,7 @@ type source struct {
PathPrefix string
}

func (s *source) readValue() {
func (s *CloudSource) readValue() {
v := Viper()
if regex.S3Matcher.MatchString(s.Kind) {
s.Value = S3Bucket{
Expand Down
14 changes: 7 additions & 7 deletions pkg/processor/native/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ func Test_isOpaqueWithoutFastOpaqueMethodShouldReturnFalse(t *testing.T) {
isOpaqueShouldReturnFalse()
}

type mockImage struct {
type MockImage struct {
rect image.Rectangle
points [][]color.Color
}

func NewMockImage(rect image.Rectangle) *mockImage {
mockImg := &mockImage{
func NewMockImage(rect image.Rectangle) *MockImage {
mockImg := &MockImage{
rect: rect,
}
points := make([][]color.Color, rect.Dy())
Expand All @@ -171,18 +171,18 @@ func NewMockImage(rect image.Rectangle) *mockImage {
return mockImg
}

func (im *mockImage) ColorModel() color.Model {
func (im *MockImage) ColorModel() color.Model {
return color.RGBAModel
}

func (im *mockImage) Bounds() image.Rectangle {
func (im *MockImage) Bounds() image.Rectangle {
return im.rect
}

func (im *mockImage) At(x, y int) color.Color {
func (im *MockImage) At(x, y int) color.Color {
return im.points[y][x]
}

func (im *mockImage) Set(x, y int, c color.Color) {
func (im *MockImage) Set(x, y int, c color.Color) {
im.points[y][x] = c
}
2 changes: 1 addition & 1 deletion pkg/service/manipulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ func trackDuration(name string, start time.Time, spec processSpec) *metrics.Upda
}

// NewManipulator takes in a Processor interface and returns a new manipulator
func NewManipulator(processor processor.Processor) *manipulator {
func NewManipulator(processor processor.Processor) Manipulator {
return &manipulator{processor: processor}
}

0 comments on commit eb47d84

Please sign in to comment.