protos

package
v0.0.0-...-8a9c74c Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package protos is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTestsHandler

func RegisterTestsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTestsHandler registers the http handlers for service Tests to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTestsHandlerClient

func RegisterTestsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestsClient) error

RegisterTestsHandlerClient registers the http handlers for service Tests to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TestsClient" to call the correct interceptors.

func RegisterTestsHandlerFromEndpoint

func RegisterTestsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTestsHandlerFromEndpoint is same as RegisterTestsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTestsServer

func RegisterTestsServer(s *grpc.Server, srv TestsServer)

Types

type Artist

type Artist struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

singular artist for a track

func (*Artist) Descriptor

func (*Artist) Descriptor() ([]byte, []int)

func (*Artist) GetName

func (m *Artist) GetName() string

func (*Artist) ProtoMessage

func (*Artist) ProtoMessage()

func (*Artist) Reset

func (m *Artist) Reset()

func (*Artist) String

func (m *Artist) String() string

func (*Artist) XXX_DiscardUnknown

func (m *Artist) XXX_DiscardUnknown()

func (*Artist) XXX_Marshal

func (m *Artist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Artist) XXX_Merge

func (m *Artist) XXX_Merge(src proto.Message)

func (*Artist) XXX_Size

func (m *Artist) XXX_Size() int

func (*Artist) XXX_Unmarshal

func (m *Artist) XXX_Unmarshal(b []byte) error

type MultiTest

type MultiTest struct {
	Name                 []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MultiTest message is intended to be used as an array of client streamed Tests

func (*MultiTest) Descriptor

func (*MultiTest) Descriptor() ([]byte, []int)

func (*MultiTest) GetName

func (m *MultiTest) GetName() []string

func (*MultiTest) ProtoMessage

func (*MultiTest) ProtoMessage()

func (*MultiTest) Reset

func (m *MultiTest) Reset()

func (*MultiTest) String

func (m *MultiTest) String() string

func (*MultiTest) XXX_DiscardUnknown

func (m *MultiTest) XXX_DiscardUnknown()

func (*MultiTest) XXX_Marshal

func (m *MultiTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MultiTest) XXX_Merge

func (m *MultiTest) XXX_Merge(src proto.Message)

func (*MultiTest) XXX_Size

func (m *MultiTest) XXX_Size() int

func (*MultiTest) XXX_Unmarshal

func (m *MultiTest) XXX_Unmarshal(b []byte) error

type SpotifyPlaylist

type SpotifyPlaylist struct {
	Tracks               []*Track `protobuf:"bytes,1,rep,name=tracks,proto3" json:"tracks,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

SpotifyPlaylist can be used to retrieve tracks from the spotify playlist id

func (*SpotifyPlaylist) Descriptor

func (*SpotifyPlaylist) Descriptor() ([]byte, []int)

func (*SpotifyPlaylist) GetTracks

func (m *SpotifyPlaylist) GetTracks() []*Track

func (*SpotifyPlaylist) ProtoMessage

func (*SpotifyPlaylist) ProtoMessage()

func (*SpotifyPlaylist) Reset

func (m *SpotifyPlaylist) Reset()

func (*SpotifyPlaylist) String

func (m *SpotifyPlaylist) String() string

func (*SpotifyPlaylist) XXX_DiscardUnknown

func (m *SpotifyPlaylist) XXX_DiscardUnknown()

func (*SpotifyPlaylist) XXX_Marshal

func (m *SpotifyPlaylist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SpotifyPlaylist) XXX_Merge

func (m *SpotifyPlaylist) XXX_Merge(src proto.Message)

func (*SpotifyPlaylist) XXX_Size

func (m *SpotifyPlaylist) XXX_Size() int

func (*SpotifyPlaylist) XXX_Unmarshal

func (m *SpotifyPlaylist) XXX_Unmarshal(b []byte) error

type Test

type Test struct {
	// name should be used as an echo
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Test message essentially is an echo that can be used to verify a test response

func (*Test) Descriptor

func (*Test) Descriptor() ([]byte, []int)

func (*Test) GetName

func (m *Test) GetName() string

func (*Test) ProtoMessage

func (*Test) ProtoMessage()

func (*Test) Reset

func (m *Test) Reset()

func (*Test) String

func (m *Test) String() string

func (*Test) XXX_DiscardUnknown

func (m *Test) XXX_DiscardUnknown()

func (*Test) XXX_Marshal

func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Test) XXX_Merge

func (m *Test) XXX_Merge(src proto.Message)

func (*Test) XXX_Size

func (m *Test) XXX_Size() int

func (*Test) XXX_Unmarshal

func (m *Test) XXX_Unmarshal(b []byte) error

type TestsClient

type TestsClient interface {
	// Stub test
	GetTest(ctx context.Context, in *Test, opts ...grpc.CallOption) (*Test, error)
	//  Get some test tracks from spotify that will eventually be synced
	GetSpotifyPlaylist(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*SpotifyPlaylist, error)
	// Test for server-side streaming
	GetSpotifyPlaylistStream(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Tests_GetSpotifyPlaylistStreamClient, error)
	// Test for client-side streaming
	GetClientStream(ctx context.Context, opts ...grpc.CallOption) (Tests_GetClientStreamClient, error)
	// Test for bidirectional streaming
	GetBidirectionalStream(ctx context.Context, opts ...grpc.CallOption) (Tests_GetBidirectionalStreamClient, error)
}

TestsClient is the client API for Tests service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTestsClient

func NewTestsClient(cc *grpc.ClientConn) TestsClient

type TestsServer

type TestsServer interface {
	// Stub test
	GetTest(context.Context, *Test) (*Test, error)
	//  Get some test tracks from spotify that will eventually be synced
	GetSpotifyPlaylist(context.Context, *empty.Empty) (*SpotifyPlaylist, error)
	// Test for server-side streaming
	GetSpotifyPlaylistStream(*empty.Empty, Tests_GetSpotifyPlaylistStreamServer) error
	// Test for client-side streaming
	GetClientStream(Tests_GetClientStreamServer) error
	// Test for bidirectional streaming
	GetBidirectionalStream(Tests_GetBidirectionalStreamServer) error
}

TestsServer is the server API for Tests service.

type Tests_GetBidirectionalStreamClient

type Tests_GetBidirectionalStreamClient interface {
	Send(*Test) error
	Recv() (*Test, error)
	grpc.ClientStream
}

type Tests_GetBidirectionalStreamServer

type Tests_GetBidirectionalStreamServer interface {
	Send(*Test) error
	Recv() (*Test, error)
	grpc.ServerStream
}

type Tests_GetClientStreamClient

type Tests_GetClientStreamClient interface {
	Send(*Test) error
	CloseAndRecv() (*MultiTest, error)
	grpc.ClientStream
}

type Tests_GetClientStreamServer

type Tests_GetClientStreamServer interface {
	SendAndClose(*MultiTest) error
	Recv() (*Test, error)
	grpc.ServerStream
}

type Tests_GetSpotifyPlaylistStreamClient

type Tests_GetSpotifyPlaylistStreamClient interface {
	Recv() (*Track, error)
	grpc.ClientStream
}

type Tests_GetSpotifyPlaylistStreamServer

type Tests_GetSpotifyPlaylistStreamServer interface {
	Send(*Track) error
	grpc.ServerStream
}

type Track

type Track struct {
	Name                 string    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Artists              []*Artist `protobuf:"bytes,2,rep,name=artists,proto3" json:"artists,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

track composed of it's name and the artists associated

func (*Track) Descriptor

func (*Track) Descriptor() ([]byte, []int)

func (*Track) GetArtists

func (m *Track) GetArtists() []*Artist

func (*Track) GetName

func (m *Track) GetName() string

func (*Track) ProtoMessage

func (*Track) ProtoMessage()

func (*Track) Reset

func (m *Track) Reset()

func (*Track) String

func (m *Track) String() string

func (*Track) XXX_DiscardUnknown

func (m *Track) XXX_DiscardUnknown()

func (*Track) XXX_Marshal

func (m *Track) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Track) XXX_Merge

func (m *Track) XXX_Merge(src proto.Message)

func (*Track) XXX_Size

func (m *Track) XXX_Size() int

func (*Track) XXX_Unmarshal

func (m *Track) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis
Package mock_proto is a generated GoMock package.
Package mock_proto is a generated GoMock package.

Jump to

Keyboard shortcuts

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