api

package
v0.0.0-...-eaceabd Latest Latest
Warning

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

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

Documentation

Overview

Package api is a generated protocol buffer package.

It is generated from these files:

service.proto

It has these top-level messages:

GetMostPopularResourceTypeSectionTimeframeRequest
CatResult
CatsResponse
MostPopularResponse
MostPopularResult

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) kit.Service

NewService will instantiate a Service with the given configuration.

func RegisterApiServiceServer

func RegisterApiServiceServer(s *grpc.Server, srv ApiServiceServer)

Types

type ApiServiceClient

type ApiServiceClient interface {
	// Request recent articles about cats.
	GetCats(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*CatsResponse, error)
	// Request the most popular articles.
	GetMostPopularResourceTypeSectionTimeframe(ctx context.Context, in *GetMostPopularResourceTypeSectionTimeframeRequest, opts ...grpc.CallOption) (*MostPopularResponse, error)
}

func NewApiServiceClient

func NewApiServiceClient(cc *grpc.ClientConn) ApiServiceClient

type ApiServiceServer

type ApiServiceServer interface {
	// Request recent articles about cats.
	GetCats(context.Context, *google_protobuf.Empty) (*CatsResponse, error)
	// Request the most popular articles.
	GetMostPopularResourceTypeSectionTimeframe(context.Context, *GetMostPopularResourceTypeSectionTimeframeRequest) (*MostPopularResponse, error)
}

type CatResult

type CatResult struct {
	Body   string `protobuf:"bytes,4,opt,name=Body" json:"Body,omitempty"`
	Byline string `protobuf:"bytes,3,opt,name=Byline" json:"Byline,omitempty"`
	Title  string `protobuf:"bytes,2,opt,name=Title" json:"Title,omitempty"`
	URL    string `protobuf:"bytes,1,opt,name=URL" json:"URL,omitempty"`
}

func (*CatResult) Descriptor

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

func (*CatResult) GetBody

func (m *CatResult) GetBody() string

func (*CatResult) GetByline

func (m *CatResult) GetByline() string

func (*CatResult) GetTitle

func (m *CatResult) GetTitle() string

func (*CatResult) GetURL

func (m *CatResult) GetURL() string

func (*CatResult) ProtoMessage

func (*CatResult) ProtoMessage()

func (*CatResult) Reset

func (m *CatResult) Reset()

func (*CatResult) String

func (m *CatResult) String() string

type CatsResponse

type CatsResponse struct {
	NumResults uint32       `protobuf:"varint,2,opt,name=NumResults" json:"NumResults,omitempty"`
	Results    []*CatResult `protobuf:"bytes,3,rep,name=Results" json:"Results,omitempty"`
	Status     string       `protobuf:"bytes,1,opt,name=Status" json:"Status,omitempty"`
}

func (*CatsResponse) Descriptor

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

func (*CatsResponse) GetNumResults

func (m *CatsResponse) GetNumResults() uint32

func (*CatsResponse) GetResults

func (m *CatsResponse) GetResults() []*CatResult

func (*CatsResponse) GetStatus

func (m *CatsResponse) GetStatus() string

func (*CatsResponse) ProtoMessage

func (*CatsResponse) ProtoMessage()

func (*CatsResponse) Reset

func (m *CatsResponse) Reset()

func (*CatsResponse) String

func (m *CatsResponse) String() string

type Config

type Config struct {
	MostPopularToken string `envconfig:"MOST_POPULAR_TOKEN"`
	SemanticToken    string `envconfig:"SEMANTIC_TOKEN"`
}

Config is a struct to contain all the needed configuration for our Service

type GetMostPopularResourceTypeSectionTimeframeRequest

type GetMostPopularResourceTypeSectionTimeframeRequest struct {
	// mostemailed|mostviewed|mostshared
	ResourceType string `protobuf:"bytes,1,opt,name=ResourceType" json:"ResourceType,omitempty"`
	// ie. Style, Arts, Books, Opinion
	Section string `protobuf:"bytes,2,opt,name=Section" json:"Section,omitempty"`
	// days to include. 1, 7 or 30
	Timeframe int32 `protobuf:"varint,3,opt,name=Timeframe" json:"Timeframe,omitempty"`
}

func (*GetMostPopularResourceTypeSectionTimeframeRequest) Descriptor

func (*GetMostPopularResourceTypeSectionTimeframeRequest) GetResourceType

func (*GetMostPopularResourceTypeSectionTimeframeRequest) GetSection

func (*GetMostPopularResourceTypeSectionTimeframeRequest) GetTimeframe

func (*GetMostPopularResourceTypeSectionTimeframeRequest) ProtoMessage

func (*GetMostPopularResourceTypeSectionTimeframeRequest) Reset

func (*GetMostPopularResourceTypeSectionTimeframeRequest) String

type MostPopularResponse

type MostPopularResponse struct {
	NumResults uint32               `protobuf:"varint,2,opt,name=NumResults" json:"NumResults,omitempty"`
	Results    []*MostPopularResult `protobuf:"bytes,3,rep,name=Results" json:"Results,omitempty"`
	Status     string               `protobuf:"bytes,1,opt,name=Status" json:"Status,omitempty"`
}

func (*MostPopularResponse) Descriptor

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

func (*MostPopularResponse) GetNumResults

func (m *MostPopularResponse) GetNumResults() uint32

func (*MostPopularResponse) GetResults

func (m *MostPopularResponse) GetResults() []*MostPopularResult

func (*MostPopularResponse) GetStatus

func (m *MostPopularResponse) GetStatus() string

func (*MostPopularResponse) ProtoMessage

func (*MostPopularResponse) ProtoMessage()

func (*MostPopularResponse) Reset

func (m *MostPopularResponse) Reset()

func (*MostPopularResponse) String

func (m *MostPopularResponse) String() string

type MostPopularResult

type MostPopularResult struct {
	Abstract      string `protobuf:"bytes,10,opt,name=Abstract" json:"Abstract,omitempty"`
	AssetID       uint64 `protobuf:"varint,3,opt,name=AssetID" json:"AssetID,omitempty"`
	Byline        string `protobuf:"bytes,7,opt,name=Byline" json:"Byline,omitempty"`
	Column        string `protobuf:"bytes,5,opt,name=Column" json:"Column,omitempty"`
	ID            uint64 `protobuf:"varint,2,opt,name=ID" json:"ID,omitempty"`
	Keywords      string `protobuf:"bytes,4,opt,name=Keywords" json:"Keywords,omitempty"`
	PublishedDate string `protobuf:"bytes,11,opt,name=PublishedDate" json:"PublishedDate,omitempty"`
	Section       string `protobuf:"bytes,6,opt,name=Section" json:"Section,omitempty"`
	Source        string `protobuf:"bytes,12,opt,name=Source" json:"Source,omitempty"`
	Title         string `protobuf:"bytes,9,opt,name=Title" json:"Title,omitempty"`
	Type          string `protobuf:"bytes,8,opt,name=Type" json:"Type,omitempty"`
	URL           string `protobuf:"bytes,1,opt,name=URL" json:"URL,omitempty"`
}

func (*MostPopularResult) Descriptor

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

func (*MostPopularResult) GetAbstract

func (m *MostPopularResult) GetAbstract() string

func (*MostPopularResult) GetAssetID

func (m *MostPopularResult) GetAssetID() uint64

func (*MostPopularResult) GetByline

func (m *MostPopularResult) GetByline() string

func (*MostPopularResult) GetColumn

func (m *MostPopularResult) GetColumn() string

func (*MostPopularResult) GetID

func (m *MostPopularResult) GetID() uint64

func (*MostPopularResult) GetKeywords

func (m *MostPopularResult) GetKeywords() string

func (*MostPopularResult) GetPublishedDate

func (m *MostPopularResult) GetPublishedDate() string

func (*MostPopularResult) GetSection

func (m *MostPopularResult) GetSection() string

func (*MostPopularResult) GetSource

func (m *MostPopularResult) GetSource() string

func (*MostPopularResult) GetTitle

func (m *MostPopularResult) GetTitle() string

func (*MostPopularResult) GetType

func (m *MostPopularResult) GetType() string

func (*MostPopularResult) GetURL

func (m *MostPopularResult) GetURL() string

func (*MostPopularResult) ProtoMessage

func (*MostPopularResult) ProtoMessage()

func (*MostPopularResult) Reset

func (m *MostPopularResult) Reset()

func (*MostPopularResult) String

func (m *MostPopularResult) String() string

Jump to

Keyboard shortcuts

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