Documentation ¶
Index ¶
Constants ¶
View Source
const LOGO = `` /* 376-byte string literal not displayed */
Variables ¶
View Source
var MOCKAPIC_CERT_DIRECTORY = os.Getenv("MOCKAPIC_CERT")
View Source
var MOCKAPIC_CERT_FILENAME = "mockapic.crt"
View Source
var MOCKAPIC_HOME = os.Getenv("MOCKAPIC_HOME")
View Source
var MOCKAPIC_PEM_FILENAME = "mockapic.key"
View Source
var MOCKAPIC_PORT = os.Getenv("MOCKAPIC_PORT")
View Source
var MOCKAPIC_REQUEST = func() string { return MOCKAPIC_HOME + "/requests" }
View Source
var MOCKAPIC_REQ_MAX_LIMIT = stringsutil.Int(os.Getenv("MOCKAPIC_REQ_MAX_LIMIT"), -1)
View Source
var MOCKAPIC_REQ_PREDEFINED_FILE = func() string { return MOCKAPIC_HOME + "/mockapic.json" }
View Source
var MOCKAPIC_SSL = stringsutil.Bool(os.Getenv("MOCKAPIC_SSL"))
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
func NewMock ¶
func NewMock(workingDirectory string, predefinedMockedRequests []PredefinedMockedRequest, logger logsutil.Logger) Mock
func (Mock) Get ¶
func (m Mock) Get(mockId string) (*MockedRequest, error)
Get finds the mocked request by {mockId} value on the storage or in the predefined requests.
func (Mock) List ¶
func (m Mock) List() ([]MockedRequestLight, error)
List gets all mocked requests on the storage and the predefined requests.
type MockedRequest ¶
type MockedRequest struct { MockedRequestLight Body string `json:"body,omitempty"` Body64 []byte `json:"body64,omitempty"` }
func (MockedRequest) Equals ¶
func (m MockedRequest) Equals(arg MockedRequest) bool
Equals returns true if the two requests are equal
type MockedRequestHeader ¶
type MockedRequestLight ¶
type MockedRequestLight struct { Id string `json:"id,omitempty"` CreatedAt string `json:"createdAt,omitempty"` MockedRequestHeader }
type PredefinedMockedRequest ¶
type PredefinedMockedRequest struct {
MockedRequest
}
Click to show internal directories.
Click to hide internal directories.