sampleservice

package
v0.0.0-...-df95b03 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewsampleServiceStub

func NewsampleServiceStub(hostPort string, opts ...stub.Option) *sampleServiceStub

func NewsampleServiceStubMock

func NewsampleServiceStubMock(opts ...MockOption) *sampleServiceStubMock

Types

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 {
	ComplexDummy(
		ctx context.Context, req *VeryComplexRequest, opt ...stub.RESTOption,
	) (*VeryComplexResponse, *stub.Error)
	ComplexDummy2(
		ctx context.Context, req *VeryComplexRequest, opt ...stub.RESTOption,
	) (*VeryComplexResponse, *stub.Error)
	GetComplexDummy(
		ctx context.Context, req *VeryComplexRequest, opt ...stub.RESTOption,
	) (*VeryComplexResponse, *stub.Error)
}

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value int    `json:"value"`
}

KeyValue is a data transfer object

type MockOption

type MockOption func(*sampleServiceStubMock)

func MockComplexDummy

func MockComplexDummy(
	f func(ctx context.Context, req *VeryComplexRequest, opt ...stub.RESTOption) (*VeryComplexResponse, *stub.Error),
) MockOption

func MockComplexDummy2

func MockComplexDummy2(
	f func(ctx context.Context, req *VeryComplexRequest, opt ...stub.RESTOption) (*VeryComplexResponse, *stub.Error),
) MockOption

func MockGetComplexDummy

func MockGetComplexDummy(
	f func(ctx context.Context, req *VeryComplexRequest, opt ...stub.RESTOption) (*VeryComplexResponse, *stub.Error),
) MockOption

type SimpleHdr

type SimpleHdr struct {
	Key1 string `json:"sKey1"`
	Key2 int    `json:"sKey2"`
}

SimpleHdr is a data transfer object

type VeryComplexRequest

type VeryComplexRequest struct {
	SimpleHdr
	Key1      string             `json:"key1"`
	Key1Ptr   *string            `json:"key1Ptr"`
	MapKey1   map[string]int     `json:"mapKey1"`
	MapKey2   map[int64]KeyValue `json:"mapKey2"`
	SliceKey1 []bool             `json:"sliceKey1"`
	SliceKey2 []*KeyValue        `json:"sliceKey2"`
	RawKey    kit.JSONMessage    `json:"rawKey"`
}

VeryComplexRequest is a data transfer object

type VeryComplexResponse

type VeryComplexResponse struct {
	Key1      string              `json:"key1,omitempty"`
	Key1Ptr   *string             `json:"key1Ptr,omitempty"`
	MapKey1   map[string]int      `json:"mapKey1,omitempty"`
	MapKey2   map[int64]*KeyValue `json:"mapKey2,omitempty"`
	SliceKey1 []uint8             `json:"sliceKey1"`
	SliceKey2 []KeyValue          `json:"sliceKey2"`
}

VeryComplexResponse is a data transfer object

Jump to

Keyboard shortcuts

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