readinglist

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package readinglist is a generated protocol buffer package.

It is generated from these files:

reading-list.proto

It has these top-level messages:

PutLinkProtoJSONRequest
GetListProtoJSONRequest
Link
LinkRequest
Links
Message

Index

Constants

View Source
const LinkKind = "Link"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, l log.Logger, opts ...httptransport.ClientOption) *Client
func (c Client) GetLinks(ctx context.Context, r *GetListProtoJSONRequest) (*Links, error)
func (c Client) PutLink(ctx context.Context, r *PutLinkProtoJSONRequest) (*Message, error)

type DB

type DB interface {
	GetLinks(ctx context.Context, userID string, limit int) ([]string, error)
	PutLink(ctx context.Context, userID string, url string) error
	DeleteLink(ctx context.Context, userID string, url string) error
}

type Datastore

type Datastore struct{}

func NewDB

func NewDB() Datastore
func (d Datastore) DeleteLink(ctx context.Context, userID string, url string) error
func (d Datastore) GetLinks(ctx context.Context, userID string, limit int) ([]string, error)
func (d Datastore) PutLink(ctx context.Context, userID string, url string) error

type GetListProtoJSONRequest

type GetListProtoJSONRequest struct {
	// The limit of links to fetch
	Limit int32 `protobuf:"varint,2,opt,name=limit" json:"limit,omitempty"`
	// The transport to respond with (Protobuf or JSON)
	ProtoJSON string `protobuf:"bytes,1,opt,name=protoJSON" json:"protoJSON,omitempty"`
	// value from Google, populated by middleware
	UserID string `protobuf:"bytes,3,opt,name=userID" json:"userID,omitempty"`
}

func (*GetListProtoJSONRequest) Descriptor

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

func (*GetListProtoJSONRequest) GetLimit

func (m *GetListProtoJSONRequest) GetLimit() int32

func (*GetListProtoJSONRequest) GetProtoJSON

func (m *GetListProtoJSONRequest) GetProtoJSON() string

func (*GetListProtoJSONRequest) GetUserID

func (m *GetListProtoJSONRequest) GetUserID() string

func (*GetListProtoJSONRequest) ProtoMessage

func (*GetListProtoJSONRequest) ProtoMessage()

func (*GetListProtoJSONRequest) Reset

func (m *GetListProtoJSONRequest) Reset()

func (*GetListProtoJSONRequest) String

func (m *GetListProtoJSONRequest) String() string
type Link struct {
	Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
}

func (*Link) Descriptor

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

func (*Link) GetUrl

func (m *Link) GetUrl() string

func (*Link) ProtoMessage

func (*Link) ProtoMessage()

func (*Link) Reset

func (m *Link) Reset()

func (*Link) String

func (m *Link) String() string

type LinkRequest

type LinkRequest struct {
	// True to remove this link from the user's list.
	Delete bool  `protobuf:"varint,1,opt,name=delete" json:"delete,omitempty"`
	Link   *Link `protobuf:"bytes,2,opt,name=link" json:"link,omitempty"`
}

func (*LinkRequest) Descriptor

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

func (*LinkRequest) GetDelete

func (m *LinkRequest) GetDelete() bool
func (m *LinkRequest) GetLink() *Link

func (*LinkRequest) ProtoMessage

func (*LinkRequest) ProtoMessage()

func (*LinkRequest) Reset

func (m *LinkRequest) Reset()

func (*LinkRequest) String

func (m *LinkRequest) String() string
type Links struct {
	Links []*Link `protobuf:"bytes,1,rep,name=links" json:"links,omitempty"`
}

func (*Links) Descriptor

func (*Links) Descriptor() ([]byte, []int)
func (m *Links) GetLinks() []*Link

func (*Links) ProtoMessage

func (*Links) ProtoMessage()

func (*Links) Reset

func (m *Links) Reset()

func (*Links) String

func (m *Links) String() string

type Message

type Message struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

func (*Message) Descriptor

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

func (*Message) GetMessage

func (m *Message) GetMessage() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

type PutLinkProtoJSONRequest

type PutLinkProtoJSONRequest struct {
	// The transport to respond with (Protobuf or JSON)
	ProtoJSON string `protobuf:"bytes,1,opt,name=protoJSON" json:"protoJSON,omitempty"`
	// The Link to save
	Request *LinkRequest `protobuf:"bytes,3,opt,name=request" json:"request,omitempty"`
	// value from Google, populated by middleware
	UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
}

func (*PutLinkProtoJSONRequest) Descriptor

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

func (*PutLinkProtoJSONRequest) GetProtoJSON

func (m *PutLinkProtoJSONRequest) GetProtoJSON() string

func (*PutLinkProtoJSONRequest) GetRequest

func (m *PutLinkProtoJSONRequest) GetRequest() *LinkRequest

func (*PutLinkProtoJSONRequest) GetUserID

func (m *PutLinkProtoJSONRequest) GetUserID() string

func (*PutLinkProtoJSONRequest) ProtoMessage

func (*PutLinkProtoJSONRequest) ProtoMessage()

func (*PutLinkProtoJSONRequest) Reset

func (m *PutLinkProtoJSONRequest) Reset()

func (*PutLinkProtoJSONRequest) String

func (m *PutLinkProtoJSONRequest) String() string

type Service

type Service interface {
	GetLinks(context.Context, *GetListProtoJSONRequest) (*Links, error)
	PutLink(context.Context, *PutLinkProtoJSONRequest) (*Message, error)
}

func NewService

func NewService(db DB) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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