Documentation
¶
Index ¶
- Constants
- Variables
- func NewHTMLProto2Server(client Proto2Client, stringer func(req, resp interface{}) ([]byte, error)) *htmlProto2
- func NewHandler(grpcAddr string, stringer func(req, resp interface{}) ([]byte, error), ...) (net_http.Handler, error)
- func RegisterProto2Server(s *grpc.Server, srv Proto2Server)
- func Serve(httpAddr, grpcAddr string, ...)
- type Album
- func (*Album) Descriptor() ([]byte, []int)
- func (m *Album) GetEpilogue() string
- func (m *Album) GetGenre() Genre
- func (m *Album) GetLikes() []bool
- func (m *Album) GetMediocre() bool
- func (m *Album) GetName() string
- func (m *Album) GetProducer() []string
- func (m *Album) GetRated() bool
- func (m *Album) GetSerial() []float64
- func (m *Album) GetSong() []*Song
- func (m *Album) GetStars() int64
- func (m *Album) GetYear() string
- func (*Album) ProtoMessage()
- func (m *Album) Reset()
- func (m *Album) String() string
- func (m *Album) XXX_DiscardUnknown()
- func (m *Album) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Album) XXX_Merge(src proto.Message)
- func (m *Album) XXX_Size() int
- func (m *Album) XXX_Unmarshal(b []byte) error
- type Artist
- func (*Artist) Descriptor() ([]byte, []int)
- func (m *Artist) GetName() string
- func (m *Artist) GetRole() Instrument
- 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 Genre
- type Instrument
- type Proto2Client
- type Proto2Server
- type Song
- func (*Song) Descriptor() ([]byte, []int)
- func (m *Song) GetComposer() []*Artist
- func (m *Song) GetDuration() float64
- func (m *Song) GetGood() bool
- func (m *Song) GetName() string
- func (m *Song) GetTrack() uint64
- func (*Song) ProtoMessage()
- func (m *Song) Reset()
- func (m *Song) String() string
- func (m *Song) XXX_DiscardUnknown()
- func (m *Song) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Song) XXX_Merge(src proto.Message)
- func (m *Song) XXX_Size() int
- func (m *Song) XXX_Unmarshal(b []byte) error
- type UnimplementedProto2Server
Constants ¶
View Source
const Default_Album_Mediocre bool = true
View Source
const Default_Album_Year string = "2015"
View Source
const Default_Song_Duration float64 = 3.3
View Source
const Default_Song_Good bool = true
View Source
const Default_Song_Name string = "Type in a Name"
View Source
const Default_Song_Track uint64 = 1
Variables ¶
View Source
var DefaultHtmlStringer = func(req, resp interface{}) ([]byte, error) { header := []byte("<p><div class=\"container\"><pre>") data, err := encoding_json.MarshalIndent(resp, "", "\t") if err != nil { return nil, err } footer := []byte("</pre></div></p>") return append(append(header, data...), footer...), nil }
View Source
</body>
</html>
`
View Source
var FormProto2_Produce string = `` /* 22881-byte string literal not displayed */
View Source
var Genre_name = map[int32]string{
0: "Pop",
1: "Rock",
2: "Jazz",
3: "NintendoCore",
4: "Indie",
5: "Punk",
6: "Dance",
}
View Source
var Genre_value = map[string]int32{
"Pop": 0,
"Rock": 1,
"Jazz": 2,
"NintendoCore": 3,
"Indie": 4,
"Punk": 5,
"Dance": 6,
}
View Source
var Header func(servName, methodName string) string = func(servName, methodName string) string {
return `
<html>
<head>
<title>` + servName + `:` + methodName + `</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
`
}
View Source
var Instrument_name = map[int32]string{
0: "Voice",
1: "Guitar",
2: "Drum",
}
View Source
var Instrument_value = map[string]int32{
"Voice": 0,
"Guitar": 1,
"Drum": 2,
}
Functions ¶
func NewHTMLProto2Server ¶
func NewHTMLProto2Server(client Proto2Client, stringer func(req, resp interface{}) ([]byte, error)) *htmlProto2
func NewHandler ¶
func NewHandler(grpcAddr string, stringer func(req, resp interface{}) ([]byte, error), opts ...google_golang_org_grpc.DialOption) (net_http.Handler, error)
func RegisterProto2Server ¶
func RegisterProto2Server(s *grpc.Server, srv Proto2Server)
func Serve ¶
func Serve(httpAddr, grpcAddr string, stringer func(req, resp interface{}) ([]byte, error), opts ...google_golang_org_grpc.DialOption)
Types ¶
type Album ¶
type Album struct { Name *string `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"` Song []*Song `protobuf:"bytes,2,rep,name=Song" json:"Song,omitempty"` Genre *Genre `protobuf:"varint,3,opt,name=Genre,enum=proto2.Genre,def=1" json:"Genre,omitempty"` Year *string `protobuf:"bytes,4,opt,name=Year,def=2015" json:"Year,omitempty"` Producer []string `protobuf:"bytes,5,rep,name=Producer" json:"Producer,omitempty"` Mediocre *bool `protobuf:"varint,6,opt,name=Mediocre,def=1" json:"Mediocre,omitempty"` Rated *bool `protobuf:"varint,7,opt,name=Rated" json:"Rated,omitempty"` Epilogue *string `protobuf:"bytes,8,opt,name=Epilogue" json:"Epilogue,omitempty"` Likes []bool `protobuf:"varint,9,rep,name=Likes" json:"Likes,omitempty"` Stars *int64 `protobuf:"varint,10,opt,name=Stars" json:"Stars,omitempty"` Serial []float64 `protobuf:"fixed64,11,rep,name=Serial" json:"Serial,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Album) Descriptor ¶
func (*Album) GetEpilogue ¶
func (*Album) GetMediocre ¶
func (*Album) GetProducer ¶
func (*Album) ProtoMessage ¶
func (*Album) ProtoMessage()
func (*Album) XXX_DiscardUnknown ¶
func (m *Album) XXX_DiscardUnknown()
func (*Album) XXX_Marshal ¶
func (*Album) XXX_Unmarshal ¶
type Artist ¶
type Artist struct { Name *string `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"` Role *Instrument `protobuf:"varint,2,opt,name=Role,enum=proto2.Instrument,def=1" json:"Role,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Artist) Descriptor ¶
func (*Artist) GetRole ¶
func (m *Artist) GetRole() Instrument
func (*Artist) ProtoMessage ¶
func (*Artist) ProtoMessage()
func (*Artist) XXX_DiscardUnknown ¶
func (m *Artist) XXX_DiscardUnknown()
func (*Artist) XXX_Marshal ¶
func (*Artist) XXX_Unmarshal ¶
type Genre ¶
type Genre int32
const Default_Album_Genre Genre = Genre_Rock
func (Genre) EnumDescriptor ¶
func (*Genre) UnmarshalJSON ¶
type Instrument ¶
type Instrument int32
const ( Instrument_Voice Instrument = 0 Instrument_Guitar Instrument = 1 Instrument_Drum Instrument = 2 )
const Default_Artist_Role Instrument = Instrument_Guitar
func (Instrument) Enum ¶
func (x Instrument) Enum() *Instrument
func (Instrument) EnumDescriptor ¶
func (Instrument) EnumDescriptor() ([]byte, []int)
func (Instrument) String ¶
func (x Instrument) String() string
func (*Instrument) UnmarshalJSON ¶
func (x *Instrument) UnmarshalJSON(data []byte) error
type Proto2Client ¶
type Proto2Client interface {
Produce(ctx context.Context, in *Album, opts ...grpc.CallOption) (*Album, error)
}
Proto2Client is the client API for Proto2 service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewProto2Client ¶
func NewProto2Client(cc *grpc.ClientConn) Proto2Client
type Proto2Server ¶
Proto2Server is the server API for Proto2 service.
type Song ¶
type Song struct { Name *string `protobuf:"bytes,1,opt,name=Name,def=Type in a Name" json:"Name,omitempty"` Track *uint64 `protobuf:"varint,2,opt,name=Track,def=1" json:"Track,omitempty"` Duration *float64 `protobuf:"fixed64,3,opt,name=Duration,def=3.3" json:"Duration,omitempty"` Composer []*Artist `protobuf:"bytes,4,rep,name=Composer" json:"Composer,omitempty"` Good *bool `protobuf:"varint,5,opt,name=Good,def=1" json:"Good,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Song) Descriptor ¶
func (*Song) GetComposer ¶
func (*Song) GetDuration ¶
func (*Song) ProtoMessage ¶
func (*Song) ProtoMessage()
func (*Song) XXX_DiscardUnknown ¶
func (m *Song) XXX_DiscardUnknown()
func (*Song) XXX_Unmarshal ¶
type UnimplementedProto2Server ¶
type UnimplementedProto2Server struct { }
UnimplementedProto2Server can be embedded to have forward compatible implementations.
Click to show internal directories.
Click to hide internal directories.