proto2

package
v0.0.0-...-6cd333e Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package proto2 is a generated protocol buffer package.

It is generated from these files:

proto2.proto

It has these top-level messages:

Artist
Song
Album

Package proto2 is a generated protocol buffer package.

It is generated from these files:

proto2.proto

It has these top-level messages:

Artist
Song
Album

Index

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
var Footer string = `
	</body>
	</html>
	`
View Source
var FormProto2_Produce = `` /* 22644-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 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_unrecognized []byte    `json:"-"`
}

func (*Album) GetEpilogue

func (m *Album) GetEpilogue() string

func (*Album) GetGenre

func (m *Album) GetGenre() Genre

func (*Album) GetLikes

func (m *Album) GetLikes() []bool

func (*Album) GetMediocre

func (m *Album) GetMediocre() bool

func (*Album) GetName

func (m *Album) GetName() string

func (*Album) GetProducer

func (m *Album) GetProducer() []string

func (*Album) GetRated

func (m *Album) GetRated() bool

func (*Album) GetSerial

func (m *Album) GetSerial() []float64

func (*Album) GetSong

func (m *Album) GetSong() []*Song

func (*Album) GetStars

func (m *Album) GetStars() int64

func (*Album) GetYear

func (m *Album) GetYear() string

func (*Album) ProtoMessage

func (*Album) ProtoMessage()

func (*Album) Reset

func (m *Album) Reset()

func (*Album) String

func (m *Album) String() string

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_unrecognized []byte      `json:"-"`
}

func (*Artist) GetName

func (m *Artist) GetName() string

func (*Artist) GetRole

func (m *Artist) GetRole() Instrument

func (*Artist) ProtoMessage

func (*Artist) ProtoMessage()

func (*Artist) Reset

func (m *Artist) Reset()

func (*Artist) String

func (m *Artist) String() string

type Genre

type Genre int32
const (
	Genre_Pop          Genre = 0
	Genre_Rock         Genre = 1
	Genre_Jazz         Genre = 2
	Genre_NintendoCore Genre = 3
	Genre_Indie        Genre = 4
	Genre_Punk         Genre = 5
	Genre_Dance        Genre = 6
)
const Default_Album_Genre Genre = Genre_Rock

func (Genre) Enum

func (x Genre) Enum() *Genre

func (Genre) String

func (x Genre) String() string

func (*Genre) UnmarshalJSON

func (x *Genre) UnmarshalJSON(data []byte) error

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) 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)
}

func NewProto2Client

func NewProto2Client(cc *grpc.ClientConn) Proto2Client

type Proto2Server

type Proto2Server interface {
	Produce(context.Context, *Album) (*Album, error)
}

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_unrecognized []byte    `json:"-"`
}

func (*Song) GetComposer

func (m *Song) GetComposer() []*Artist

func (*Song) GetDuration

func (m *Song) GetDuration() float64

func (*Song) GetGood

func (m *Song) GetGood() bool

func (*Song) GetName

func (m *Song) GetName() string

func (*Song) GetTrack

func (m *Song) GetTrack() uint64

func (*Song) ProtoMessage

func (*Song) ProtoMessage()

func (*Song) Reset

func (m *Song) Reset()

func (*Song) String

func (m *Song) String() string

Jump to

Keyboard shortcuts

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