models

package
v0.0.0-...-f47669d Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package models is a generated protocol buffer package.

It is generated from these files:

birds.proto

It has these top-level messages:

Empty
Bird
BirdId
BirdCatalog

Index

Constants

This section is empty.

Variables

View Source
var Bird_BirdType_name = map[int32]string{
	0:  "BLACKBIRD",
	1:  "BLACKBIRDSCHICKADEE",
	2:  "CHICKADEESCROW",
	3:  "CROWSDOVE",
	4:  "DOVESDUCK",
	5:  "DUCKSFINCH",
	6:  "FINCHESFLYCATCHER",
	7:  "FLYCATCHERSGAMEBIRD",
	8:  "GAMEBIRDSGULL",
	9:  "GULLSHAWK",
	10: "HAWKSHERON",
	11: "HERONSHUMMINGBIRD",
	12: "HUMMINGBIRDSKINGFISHER",
	13: "KINGFISHERSNUTHATCH",
	14: "NUTHATCHESOWL",
	15: "OWLSSHOREBIRD",
	16: "SHOREBIRDSSPARROW",
	17: "SPARROWSSWALLOW",
	18: "SWALLOWSTHRUSH",
	19: "THRUSHESWARBLER",
	20: "WARBLERSWOODPECKER",
	21: "WOODPECKERSWREN",
	22: "WRENS",
	23: "UNKNOWN",
}
View Source
var Bird_BirdType_value = map[string]int32{
	"BLACKBIRD":              0,
	"BLACKBIRDSCHICKADEE":    1,
	"CHICKADEESCROW":         2,
	"CROWSDOVE":              3,
	"DOVESDUCK":              4,
	"DUCKSFINCH":             5,
	"FINCHESFLYCATCHER":      6,
	"FLYCATCHERSGAMEBIRD":    7,
	"GAMEBIRDSGULL":          8,
	"GULLSHAWK":              9,
	"HAWKSHERON":             10,
	"HERONSHUMMINGBIRD":      11,
	"HUMMINGBIRDSKINGFISHER": 12,
	"KINGFISHERSNUTHATCH":    13,
	"NUTHATCHESOWL":          14,
	"OWLSSHOREBIRD":          15,
	"SHOREBIRDSSPARROW":      16,
	"SPARROWSSWALLOW":        17,
	"SWALLOWSTHRUSH":         18,
	"THRUSHESWARBLER":        19,
	"WARBLERSWOODPECKER":     20,
	"WOODPECKERSWREN":        21,
	"WRENS":                  22,
	"UNKNOWN":                23,
}

Functions

func GetBirdTypeStringFromType

func GetBirdTypeStringFromType(birdType Bird_BirdType) (birdTypeStr string)

GetBirdTypeStringFromType converts Bird_BirdType to string

func RegisterBirdRepositoryServer

func RegisterBirdRepositoryServer(s *grpc.Server, srv BirdRepositoryServer)

Types

type Bird

type Bird struct {
	Name string        `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Id   int64         `protobuf:"varint,2,opt,name=id" json:"id,omitempty"`
	Age  int32         `protobuf:"varint,3,opt,name=age" json:"age,omitempty"`
	Type Bird_BirdType `protobuf:"varint,4,opt,name=type,enum=Bird_BirdType" json:"type,omitempty"`
}

func (*Bird) Descriptor

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

func (*Bird) ProtoMessage

func (*Bird) ProtoMessage()

func (*Bird) Reset

func (m *Bird) Reset()

func (*Bird) String

func (m *Bird) String() string

type BirdCatalog

type BirdCatalog struct {
	Birds []*Bird `protobuf:"bytes,1,rep,name=birds" json:"birds,omitempty"`
}

func (*BirdCatalog) Descriptor

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

func (*BirdCatalog) GetBirds

func (m *BirdCatalog) GetBirds() []*Bird

func (*BirdCatalog) ProtoMessage

func (*BirdCatalog) ProtoMessage()

func (*BirdCatalog) Reset

func (m *BirdCatalog) Reset()

func (*BirdCatalog) String

func (m *BirdCatalog) String() string

type BirdId

type BirdId struct {
	Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
}

func (*BirdId) Descriptor

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

func (*BirdId) ProtoMessage

func (*BirdId) ProtoMessage()

func (*BirdId) Reset

func (m *BirdId) Reset()

func (*BirdId) String

func (m *BirdId) String() string

type BirdRecord

type BirdRecord struct {
	ID   int64  `json:"id"    db:"bird_id"`
	Name string `json:"name"  db:"bird_name"`
	Age  int32  `json:"age"   db:"bird_age"`
	Type string `json:"type"  db:"bird_type"`
}

BirdRecord data

type BirdRepositoryClient

type BirdRepositoryClient interface {
	AllBirds(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BirdCatalog, error)
	CreateBird(ctx context.Context, in *Bird, opts ...grpc.CallOption) (*Bird, error)
	ReadBird(ctx context.Context, in *BirdId, opts ...grpc.CallOption) (*Bird, error)
	UpdateBird(ctx context.Context, in *Bird, opts ...grpc.CallOption) (*Bird, error)
	DeleteBird(ctx context.Context, in *BirdId, opts ...grpc.CallOption) (*Empty, error)
}

func NewBirdRepositoryClient

func NewBirdRepositoryClient(cc *grpc.ClientConn) BirdRepositoryClient

type BirdRepositoryServer

type BirdRepositoryServer interface {
	AllBirds(context.Context, *Empty) (*BirdCatalog, error)
	CreateBird(context.Context, *Bird) (*Bird, error)
	ReadBird(context.Context, *BirdId) (*Bird, error)
	UpdateBird(context.Context, *Bird) (*Bird, error)
	DeleteBird(context.Context, *BirdId) (*Empty, error)
}

type Bird_BirdType

type Bird_BirdType int32
const (
	Bird_BLACKBIRD              Bird_BirdType = 0
	Bird_BLACKBIRDSCHICKADEE    Bird_BirdType = 1
	Bird_CHICKADEESCROW         Bird_BirdType = 2
	Bird_CROWSDOVE              Bird_BirdType = 3
	Bird_DOVESDUCK              Bird_BirdType = 4
	Bird_DUCKSFINCH             Bird_BirdType = 5
	Bird_FINCHESFLYCATCHER      Bird_BirdType = 6
	Bird_FLYCATCHERSGAMEBIRD    Bird_BirdType = 7
	Bird_GAMEBIRDSGULL          Bird_BirdType = 8
	Bird_GULLSHAWK              Bird_BirdType = 9
	Bird_HAWKSHERON             Bird_BirdType = 10
	Bird_HERONSHUMMINGBIRD      Bird_BirdType = 11
	Bird_HUMMINGBIRDSKINGFISHER Bird_BirdType = 12
	Bird_KINGFISHERSNUTHATCH    Bird_BirdType = 13
	Bird_NUTHATCHESOWL          Bird_BirdType = 14
	Bird_OWLSSHOREBIRD          Bird_BirdType = 15
	Bird_SHOREBIRDSSPARROW      Bird_BirdType = 16
	Bird_SPARROWSSWALLOW        Bird_BirdType = 17
	Bird_SWALLOWSTHRUSH         Bird_BirdType = 18
	Bird_THRUSHESWARBLER        Bird_BirdType = 19
	Bird_WARBLERSWOODPECKER     Bird_BirdType = 20
	Bird_WOODPECKERSWREN        Bird_BirdType = 21
	Bird_WRENS                  Bird_BirdType = 22
	Bird_UNKNOWN                Bird_BirdType = 23
)

func BirdTypeFromString

func BirdTypeFromString(birdTypeStr string) (birdType Bird_BirdType)

BirdTypeFromString converts a string into a Bird_BirdType

func (Bird_BirdType) EnumDescriptor

func (Bird_BirdType) EnumDescriptor() ([]byte, []int)

func (Bird_BirdType) String

func (x Bird_BirdType) String() string

type BirdsDataStore

type BirdsDataStore interface {
	ReadAllBirds() (birds []*BirdRecord, err error)
	CreateBird(bird *BirdRecord) (err error)
	ReadBird(id int64) (bird *BirdRecord, err error)
	UpdateBird(bird *BirdRecord) (err error)
	DeleteBird(id int64) (err error)
}

BirdsDataStore represents interface to manage birds

func NewBirdsDB

func NewBirdsDB(dbURL string) BirdsDataStore

NewBirdsDB returns a new BirdsDataStore

type Empty

type Empty struct {
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

Jump to

Keyboard shortcuts

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