db

package
v0.0.0-...-0e67cbf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package db provides the various service clients for getting data from an implementation.

Package db is a generated protocol buffer package.

It is generated from these files:

db.proto

It has these top-level messages:

TodoListRequest
TodoEntry
TodoListResponse
UserProfileRequest
UserProfileResponse
UserProfile

Index

Constants

View Source
const (
	// DummyDB is the name of the dummy service implementation of the
	// various handlers.
	DummyDB = "org.sugr.micro.test.db.dummy"
)

Variables

This section is empty.

Functions

func RegisterTodoHandler

func RegisterTodoHandler(s server.Server, hdlr TodoHandler, opts ...server.HandlerOption)

func RegisterUserHandler

func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.HandlerOption)

Types

type Todo

type Todo struct {
	TodoHandler
}

func (*Todo) List

func (h *Todo) List(ctx context.Context, in *TodoListRequest, out *TodoListResponse) error

type TodoClient

type TodoClient interface {
	// TodoList returns a list of todo items.
	List(ctx context.Context, in *TodoListRequest, opts ...client.CallOption) (*TodoListResponse, error)
}

func NewTodoClient

func NewTodoClient(serviceName string, c client.Client) TodoClient

type TodoEntry

type TodoEntry struct {
	Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"`
	Body  string `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"`
}

func (*TodoEntry) Descriptor

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

func (*TodoEntry) ProtoMessage

func (*TodoEntry) ProtoMessage()

func (*TodoEntry) Reset

func (m *TodoEntry) Reset()

func (*TodoEntry) String

func (m *TodoEntry) String() string

type TodoHandler

type TodoHandler interface {
	// TodoList returns a list of todo items.
	List(context.Context, *TodoListRequest, *TodoListResponse) error
}

type TodoListRequest

type TodoListRequest struct {
	User   string `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
	Limit  int64  `protobuf:"varint,2,opt,name=limit" json:"limit,omitempty"`
	Offset int64  `protobuf:"varint,3,opt,name=offset" json:"offset,omitempty"`
}

TodoListRequest is used for fetching a user's todo list

func (*TodoListRequest) Descriptor

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

func (*TodoListRequest) ProtoMessage

func (*TodoListRequest) ProtoMessage()

func (*TodoListRequest) Reset

func (m *TodoListRequest) Reset()

func (*TodoListRequest) String

func (m *TodoListRequest) String() string

type TodoListResponse

type TodoListResponse struct {
	Exists  bool         `protobuf:"varint,1,opt,name=exists" json:"exists,omitempty"`
	Entries []*TodoEntry `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"`
}

func (*TodoListResponse) Descriptor

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

func (*TodoListResponse) GetEntries

func (m *TodoListResponse) GetEntries() []*TodoEntry

func (*TodoListResponse) ProtoMessage

func (*TodoListResponse) ProtoMessage()

func (*TodoListResponse) Reset

func (m *TodoListResponse) Reset()

func (*TodoListResponse) String

func (m *TodoListResponse) String() string

type User

type User struct {
	UserHandler
}

func (*User) Profile

func (h *User) Profile(ctx context.Context, in *UserProfileRequest, out *UserProfileResponse) error

type UserClient

type UserClient interface {
	// UserProfile returns a user profile.
	Profile(ctx context.Context, in *UserProfileRequest, opts ...client.CallOption) (*UserProfileResponse, error)
}

func NewUserClient

func NewUserClient(serviceName string, c client.Client) UserClient

type UserHandler

type UserHandler interface {
	// UserProfile returns a user profile.
	Profile(context.Context, *UserProfileRequest, *UserProfileResponse) error
}

type UserProfile

type UserProfile struct {
	User string `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Pass string `protobuf:"bytes,3,opt,name=pass" json:"pass,omitempty"`
}

func (*UserProfile) Descriptor

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

func (*UserProfile) ProtoMessage

func (*UserProfile) ProtoMessage()

func (*UserProfile) Reset

func (m *UserProfile) Reset()

func (*UserProfile) String

func (m *UserProfile) String() string

type UserProfileRequest

type UserProfileRequest struct {
	User string `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
}

func (*UserProfileRequest) Descriptor

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

func (*UserProfileRequest) ProtoMessage

func (*UserProfileRequest) ProtoMessage()

func (*UserProfileRequest) Reset

func (m *UserProfileRequest) Reset()

func (*UserProfileRequest) String

func (m *UserProfileRequest) String() string

type UserProfileResponse

type UserProfileResponse struct {
	Exists  bool         `protobuf:"varint,1,opt,name=exists" json:"exists,omitempty"`
	Profile *UserProfile `protobuf:"bytes,2,opt,name=profile" json:"profile,omitempty"`
}

func (*UserProfileResponse) Descriptor

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

func (*UserProfileResponse) GetProfile

func (m *UserProfileResponse) GetProfile() *UserProfile

func (*UserProfileResponse) ProtoMessage

func (*UserProfileResponse) ProtoMessage()

func (*UserProfileResponse) Reset

func (m *UserProfileResponse) Reset()

func (*UserProfileResponse) String

func (m *UserProfileResponse) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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