fake

package
v0.0.0-...-0559e17 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestBodyFromFile

func RequestBodyFromFile(filePath, parameters string) (io.Reader, string, error)

RequestBodyFromFile builds a multipart request from a file.

Types

type Service

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

Service is a fake implementation of the Asset Store service.

func NewService

func NewService() *Service

NewService is a constructor that creates a new fake service.

func (*Service) Register

func (s *Service) Register(endpoint service.HTTPEndpoint)

Register adds endpoints to the service.

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(method, endpoint, contentType string, body io.Reader) *http.Response

ServeHTTP dispatches the request to the handler that most closely matches the request URL in its pattern.

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start configures routes in the fake service.

Jump to

Keyboard shortcuts

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