sampleservice

package
v0.6.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Stub Package

This package should holds the auto-generated stub codes, which make it easier for the user of the service easily import it and use the methods.

  • This is a work in progress feature and is not completed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EchoRequest

type EchoRequest struct {
	RandomID int64 `json:"randomID"`
	Ok       bool  `json:"ok"`
}

EchoRequest is a data transfer object

type EchoResponse

type EchoResponse struct {
	RandomID int64 `json:"randomID"`
	Ok       bool  `json:"ok"`
}

EchoResponse is a data transfer object

type EmbeddedHeader

type EmbeddedHeader struct {
	SomeKey1 string `json:"someKey1"`
	SomeInt1 int64  `json:"someInt1"`
}

EmbeddedHeader is a data transfer object

type ErrorMessage

type ErrorMessage struct {
	Code int    `json:"code"`
	Item string `json:"item"`
}

ErrorMessage is a data transfer object

func (ErrorMessage) GetCode

func (x ErrorMessage) GetCode() int

func (ErrorMessage) GetItem

func (x ErrorMessage) GetItem() string

type ISampleServiceStub

type ISampleServiceStub interface {
	EchoGET(
		ctx context.Context, req *EchoRequest, opt ...stub.RESTOption,
	) (*EchoResponse, *stub.Error)
	EchoPOST(
		ctx context.Context, req *EchoRequest, opt ...stub.RESTOption,
	) (*EchoResponse, *stub.Error)
	Sum1(
		ctx context.Context, req *SumRequest, opt ...stub.RESTOption,
	) (*SumResponse, *stub.Error)
	Sum2(
		ctx context.Context, req *SumRequest, opt ...stub.RESTOption,
	) (*SumResponse, *stub.Error)
	SumRedirect(
		ctx context.Context, req *SumRequest, opt ...stub.RESTOption,
	) (*SumResponse, *stub.Error)
}

type MockOption

type MockOption func(*SampleServiceStubMock)

func MockEchoGET

func MockEchoGET(
	f func(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error),
) MockOption

func MockEchoPOST

func MockEchoPOST(
	f func(ctx context.Context, req *EchoRequest, opt ...stub.RESTOption) (*EchoResponse, *stub.Error),
) MockOption

func MockSum1

func MockSum1(
	f func(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error),
) MockOption

func MockSum2

func MockSum2(
	f func(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error),
) MockOption

func MockSumRedirect

func MockSumRedirect(
	f func(ctx context.Context, req *SumRequest, opt ...stub.RESTOption) (*SumResponse, *stub.Error),
) MockOption

type RedirectRequest

type RedirectRequest struct {
	URL string `json:"url"`
}

RedirectRequest is a data transfer object

type SampleServiceStub

type SampleServiceStub struct {
	// contains filtered or unexported fields
}

SampleServiceStub represents the client/stub for SampleService. Implements ISampleServiceStub

func NewSampleServiceStub

func NewSampleServiceStub(hostPort string, opts ...stub.Option) *SampleServiceStub

func (SampleServiceStub) EchoGET

func (s SampleServiceStub) EchoGET(
	ctx context.Context, req *EchoRequest, opt ...stub.RESTOption,
) (*EchoResponse, *stub.Error)

func (SampleServiceStub) EchoPOST

func (s SampleServiceStub) EchoPOST(
	ctx context.Context, req *EchoRequest, opt ...stub.RESTOption,
) (*EchoResponse, *stub.Error)

func (SampleServiceStub) Sum1

func (s SampleServiceStub) Sum1(
	ctx context.Context, req *SumRequest, opt ...stub.RESTOption,
) (*SumResponse, *stub.Error)

func (SampleServiceStub) Sum2

func (s SampleServiceStub) Sum2(
	ctx context.Context, req *SumRequest, opt ...stub.RESTOption,
) (*SumResponse, *stub.Error)

func (SampleServiceStub) SumRedirect

func (s SampleServiceStub) SumRedirect(
	ctx context.Context, req *SumRequest, opt ...stub.RESTOption,
) (*SumResponse, *stub.Error)

type SampleServiceStubMock

type SampleServiceStubMock struct {
	// contains filtered or unexported fields
}

SampleServiceStubMock represents the mocked for client/stub for SampleService. Implements ISampleServiceStub

func NewSampleServiceStubMock

func NewSampleServiceStubMock(opts ...MockOption) *SampleServiceStubMock

func (SampleServiceStubMock) EchoGET

func (s SampleServiceStubMock) EchoGET(
	ctx context.Context, req *EchoRequest, opt ...stub.RESTOption,
) (*EchoResponse, *stub.Error)

func (SampleServiceStubMock) EchoPOST

func (s SampleServiceStubMock) EchoPOST(
	ctx context.Context, req *EchoRequest, opt ...stub.RESTOption,
) (*EchoResponse, *stub.Error)

func (SampleServiceStubMock) Sum1

func (SampleServiceStubMock) Sum2

func (SampleServiceStubMock) SumRedirect

func (s SampleServiceStubMock) SumRedirect(
	ctx context.Context, req *SumRequest, opt ...stub.RESTOption,
) (*SumResponse, *stub.Error)

type SumRequest

type SumRequest struct {
	EmbeddedHeader
	Val1 int64 `json:"val1"`
	Val2 int64 `json:"val2"`
}

SumRequest is a data transfer object

type SumResponse

type SumResponse struct {
	EmbeddedHeader
	Val int64 `json:"val"`
}

SumResponse is a data transfer object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL