api

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMigrationsAPI

func AddMigrationsAPI(apiRouter *mux.Router, context *Context)

AddMigrationsAPI registers migrations endpoints on the given router.

func AddWorkspacesAPI

func AddWorkspacesAPI(apiRouter *mux.Router, context *Context)

AddWorkspacesAPI registers workspaces endpoints on the given router.

func Create

func Create(rootRouter *mux.Router, context *Context) *mux.Router

Register registers the API endpoints on the given router.

Types

type Context

type Context struct {
	RequestID         string
	WorkspaceService  *workspaces.Service
	MigrationsService *migrations.Service
	Logger            log.FieldLogger
}

Context provides the API with all necessary data and interfaces for responding to requests.

It is cloned before each request, allowing per-request changes such as logger annotations.

func (*Context) Clone

func (c *Context) Clone() *Context

Clone creates a shallow copy of context, allowing clones to apply per-request changes.

type ContextHandler

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

ContextHandler for HTTP

func NewContextHandler

func NewContextHandler(context *Context, handler ContextHandlerFunc) *ContextHandler

NewContextHandler to create a handler for context

func (ContextHandler) ServeHTTP

func (h ContextHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP for server to run HTTP

type ContextHandlerFunc

type ContextHandlerFunc func(c *Context, w http.ResponseWriter, r *http.Request)

ContextHandlerFunc to add context

type PonosClient

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

func NewPonosClient

func NewPonosClient(token, url string) *PonosClient

NewPonosClient factory method to create a Ponos Client

func (*PonosClient) CreateMiration

func (c *PonosClient) CreateMiration(data migrations.CustomerMigrationRequest) error

CreateMiration will create the necessary resources for migrating a customer in cloud with AWAT. Resources: - S3 Bucket - IAM resouces & policy

func (*PonosClient) DeleteMiration

func (c *PonosClient) DeleteMiration(data migrations.CustomerMigrationRequest) error

DeleteMiration will delete the created resources for migrating a customer in cloud with AWAT. Resources: - S3 Bucket - IAM resouces & policy

func (*PonosClient) DeleteWorkspace

func (c *PonosClient) DeleteWorkspace(data workspaces.DeleteWorkspaceRequest) error

DeleteWorkspace will make a request to delete a workspace

Jump to

Keyboard shortcuts

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