Documentation ¶
Overview ¶
Package protos is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterTestsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTestsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestsClient) error
- func RegisterTestsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTestsServer(s *grpc.Server, srv TestsServer)
- type Artist
- func (*Artist) Descriptor() ([]byte, []int)
- func (m *Artist) GetName() string
- func (*Artist) ProtoMessage()
- func (m *Artist) Reset()
- func (m *Artist) String() string
- func (m *Artist) XXX_DiscardUnknown()
- func (m *Artist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Artist) XXX_Merge(src proto.Message)
- func (m *Artist) XXX_Size() int
- func (m *Artist) XXX_Unmarshal(b []byte) error
- type MultiTest
- func (*MultiTest) Descriptor() ([]byte, []int)
- func (m *MultiTest) GetName() []string
- func (*MultiTest) ProtoMessage()
- func (m *MultiTest) Reset()
- func (m *MultiTest) String() string
- func (m *MultiTest) XXX_DiscardUnknown()
- func (m *MultiTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MultiTest) XXX_Merge(src proto.Message)
- func (m *MultiTest) XXX_Size() int
- func (m *MultiTest) XXX_Unmarshal(b []byte) error
- type SpotifyPlaylist
- func (*SpotifyPlaylist) Descriptor() ([]byte, []int)
- func (m *SpotifyPlaylist) GetTracks() []*Track
- func (*SpotifyPlaylist) ProtoMessage()
- func (m *SpotifyPlaylist) Reset()
- func (m *SpotifyPlaylist) String() string
- func (m *SpotifyPlaylist) XXX_DiscardUnknown()
- func (m *SpotifyPlaylist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SpotifyPlaylist) XXX_Merge(src proto.Message)
- func (m *SpotifyPlaylist) XXX_Size() int
- func (m *SpotifyPlaylist) XXX_Unmarshal(b []byte) error
- type Test
- func (*Test) Descriptor() ([]byte, []int)
- func (m *Test) GetName() string
- func (*Test) ProtoMessage()
- func (m *Test) Reset()
- func (m *Test) String() string
- func (m *Test) XXX_DiscardUnknown()
- func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Test) XXX_Merge(src proto.Message)
- func (m *Test) XXX_Size() int
- func (m *Test) XXX_Unmarshal(b []byte) error
- type TestsClient
- type TestsServer
- type Tests_GetBidirectionalStreamClient
- type Tests_GetBidirectionalStreamServer
- type Tests_GetClientStreamClient
- type Tests_GetClientStreamServer
- type Tests_GetSpotifyPlaylistStreamClient
- type Tests_GetSpotifyPlaylistStreamServer
- type Track
- func (*Track) Descriptor() ([]byte, []int)
- func (m *Track) GetArtists() []*Artist
- func (m *Track) GetName() string
- func (*Track) ProtoMessage()
- func (m *Track) Reset()
- func (m *Track) String() string
- func (m *Track) XXX_DiscardUnknown()
- func (m *Track) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Track) XXX_Merge(src proto.Message)
- func (m *Track) XXX_Size() int
- func (m *Track) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTestsHandler ¶
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) ProtoMessage ¶
func (*Artist) ProtoMessage()
func (*Artist) XXX_DiscardUnknown ¶
func (m *Artist) XXX_DiscardUnknown()
func (*Artist) XXX_Marshal ¶
func (*Artist) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*MultiTest) ProtoMessage()
func (*MultiTest) XXX_DiscardUnknown ¶
func (m *MultiTest) XXX_DiscardUnknown()
func (*MultiTest) XXX_Marshal ¶
func (*MultiTest) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*Test) ProtoMessage()
func (*Test) XXX_DiscardUnknown ¶
func (m *Test) XXX_DiscardUnknown()
func (*Test) XXX_Unmarshal ¶
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_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) GetArtists ¶
func (*Track) ProtoMessage ¶
func (*Track) ProtoMessage()
func (*Track) XXX_DiscardUnknown ¶
func (m *Track) XXX_DiscardUnknown()