acsclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2015 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 18 Imported by: 0

Documentation

Overview

Package acsclient wraps the generated aws-sdk-go client to provide marshalling and unmarshalling of data over a websocket connection in the format expected by ACS. It allows for bidirectional communication and acts as both a client-and-server in terms of requests, but only as a client in terms of connecting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewACSError

func NewACSError(err interface{}) *acsError

NewACSError returns an error corresponding to a typed error returned from ACS. It is expected that the passed in interface{} is really a struct which has a 'Message' field of type *string. In that case, the Message will be conveyed as part of the Error string as well as the type. It is safe to pass anything into this constructor and it will also work reasonably well with anything fulfilling the 'error' interface.

func NewOfType

func NewOfType(acsType string) (interface{}, bool)

Types

type ClientServer

type ClientServer interface {
	AddRequestHandler(RequestHandler)
	MakeRequest(input interface{}) error
	Connect() error
	Serve() error
	io.Closer
}

ClientServer is a combined client and server for the ACS websocket connection

func New

func New(url string, region string, credentialProvider credentials.AWSCredentialProvider, acceptInvalidCert bool) ClientServer

New returns a client/server to bidirectionally communicate with ACS The returned struct should have both 'Connect' and 'Serve' called upon it before being used.

type NotMarshallableACSRequest

type NotMarshallableACSRequest struct {
	Type string
	// contains filtered or unexported fields
}

NotMarshallableACSRequest represents that the given request input could not be marshalled

func (*NotMarshallableACSRequest) Error

func (u *NotMarshallableACSRequest) Error() string

Error implements error

func (*NotMarshallableACSRequest) Retry

func (u *NotMarshallableACSRequest) Retry() bool

Retry implementes Retriable

type RequestHandler

type RequestHandler interface{}

More properly this would be func(*ecsacs.T for T in ecsacs.*), but it needs to be interface{} to properly capture that

type UndecodableMessage

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

UndecodableMessage indicates that a message from ACS could not be decoded

func (*UndecodableMessage) Error

func (u *UndecodableMessage) Error() string

type UnrecognizedACSRequestType

type UnrecognizedACSRequestType struct {
	Type string
}

UnrecognizedACSRequestType specifies that a given type is not recognized. This error is not retriable.

func (*UnrecognizedACSRequestType) Error

Error implements error

func (*UnrecognizedACSRequestType) Retry

func (u *UnrecognizedACSRequestType) Retry() bool

Retry implements Retriable

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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