port

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForGRPCConn

func WaitForGRPCConn()

Types

type ClientPort

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

func NewGRPCClient

func NewGRPCClient(i interface{}, target string, opts ...PortOpt) (*ClientPort, error)

func (*ClientPort) Close

func (p *ClientPort) Close()

func (*ClientPort) Receive

func (p *ClientPort) Receive(ctx context.Context) (interface{}, error)

func (*ClientPort) Send

func (p *ClientPort) Send(ctx context.Context, msg interface{}) error

type EndpointRespTypePair

type EndpointRespTypePair struct {
	RespType reflect.Type
	Endpoint string
}

type FTPEvent

type FTPEvent struct {
	Path    string
	Payload []byte
}

type FTPPort

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

func NewFTP

func NewFTP(addr, user, pass string) (*FTPPort, error)

func (*FTPPort) Receive

func (p *FTPPort) Receive(ctx context.Context) (interface{}, error)

func (*FTPPort) Send

func (p *FTPPort) Send(ctx context.Context, i interface{}) error

type GCStorage

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

func NewGCStoragePort

func NewGCStoragePort() *GCStorage

func (*GCStorage) Receive

func (s *GCStorage) Receive(ctx context.Context) (interface{}, error)

func (*GCStorage) Send

func (s *GCStorage) Send(ctx context.Context, i interface{}) error

type GRPCErr

type GRPCErr struct {
	Err error
}

type HTTPPort

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

func (*HTTPPort) Receive

func (p *HTTPPort) Receive(ctx context.Context) (interface{}, error)

func (*HTTPPort) Register

func (p *HTTPPort) Register(router *mux.Router)

func (*HTTPPort) Send

func (p *HTTPPort) Send(ctx context.Context, i interface{}) error

func (*HTTPPort) ServeHTTP

func (p *HTTPPort) ServeHTTP(w http.ResponseWriter, req *http.Request)

type HTTPRequest

type HTTPRequest struct {
	Body []byte
	//URL    *url.URL
	Method string
	Host   string
	URL    string
}

type HTTPResponse

type HTTPResponse struct {
	Body   []byte
	Status int
}

type MsgTypeMap

type MsgTypeMap map[reflect.Type]EndpointRespTypePair

type Opt

type Opt func(*portOpts)

func WithError

func WithError(err error) Opt

func WithT

func WithT(t *testing.T) Opt

func WithTimeout

func WithTimeout(timout time.Duration) Opt

type Port

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

func NewFTPPort

func NewFTPPort(addr, user, pass string) (*Port, error)

func NewGCSPort

func NewGCSPort() (*Port, error)

func NewGRPCClientPort

func NewGRPCClientPort(i interface{}, target string, opts ...PortOpt) (*Port, error)

func NewGRPCServerPort

func NewGRPCServerPort(i interface{}, port string, opts ...PortOpt) (*Port, error)

func NewGRPCServersPort

func NewGRPCServersPort(ii []interface{}, port string, opts ...PortOpt) (*Port, error)

func NewHTTPPort

func NewHTTPPort() *Port

func NewPubsub

func NewPubsub(projectID, addr string) (*Port, error)

func (*Port) Receive

func (p *Port) Receive(t *testing.T, i interface{}) (interface{}, error)

func (*Port) Send

func (p *Port) Send(t *testing.T, i interface{}, opts ...SendOption) error

type PortImpl

type PortImpl interface {
	Send(ctx context.Context, msg interface{}) error
	Receive(ctx context.Context) (interface{}, error)
}

type PortIn

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

func NewGRPCServer

func NewGRPCServer(i interface{}, port string, opts ...PortOpt) (*PortIn, error)

func NewGRPCServers

func NewGRPCServers(ii []interface{}, port string, opts ...PortOpt) (*PortIn, error)

func (*PortIn) Receive

func (p *PortIn) Receive(ctx context.Context) (interface{}, error)

func (*PortIn) Send

func (p *PortIn) Send(ctx context.Context, i interface{}) error

type PortOpt

type PortOpt func(*portOpts)

func WithTLS

func WithTLS() PortOpt

type PubSubSendRequest

type PubSubSendRequest struct {
	Topic   string
	Message proto.Message
}

type Pubsub

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

func (*Pubsub) Receive

func (p *Pubsub) Receive(ctx context.Context) (interface{}, error)

func (*Pubsub) Send

func (p *Pubsub) Send(ctx context.Context, i interface{}) error

type SendOption

type SendOption func(*sendOptions)

func WithCtx

func WithCtx(ctx context.Context) SendOption

type StorageGetRequest

type StorageGetRequest struct {
	Bucket string
	Object string
}

type StorageGetResponse

type StorageGetResponse struct {
	Content []byte
}

type StorageInsertRequest

type StorageInsertRequest struct {
	Bucket  string
	Object  string
	Content []byte
}

type StorageInsertResponse

type StorageInsertResponse struct {
}

Jump to

Keyboard shortcuts

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