fakelegacy

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	ID        string
	Status    Status
	UserEmail string
}

A Job represents some fake legacy pinpoint job.

type Server

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

Server implements a fake Legacy Pinpoint service. Use NewServer to make one.

func NewServer

func NewServer(templateDir string, jobData map[string]*Job) (*Server, error)

NewServer sets up a fake Pinpoint Legacy HTTP server configured to serve response templates from the provided templateDir. If jobData is not nil, the map is used as the backing store in the Server.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns a Handler which implements the entire REST API for Server.

type Status

type Status string
const (
	QueuedStatus    Status = "Queued"
	RunningStatus   Status = "Running"
	CancelledStatus Status = "Cancelled"
	FailedStatus    Status = "Failed"
	CompletedStatus Status = "Completed"
)

type Template

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

Template represents a single API response template.

func (*Template) Execute

func (t *Template) Execute(dst io.Writer, data interface{}) error

Execute applies the data to the API response template and writes the result to the provided Writer.

type Templates

type Templates struct {
	Job  Template
	List Template
	New  Template
}

Templates represents the set of templates needed by the fake legacy service. Each specific template will have its own field. Use loadTemplates to create a new set of Templates.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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