common

package
v0.0.0-...-9d8b9bc Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterConfigServer

func RegisterConfigServer(s *grpc.Server, srv ConfigServer)

func RegisterStoreServer

func RegisterStoreServer(s *grpc.Server, srv StoreServer)

func RegisterUserServer

func RegisterUserServer(s *grpc.Server, srv UserServer)

Types

type ConfigClient

type ConfigClient interface {
	GetServeWork(ctx context.Context, in *ServeWorkRequest, opts ...grpc.CallOption) (*ServeWork, error)
	GetFetchWork(ctx context.Context, in *FetchWorkRequest, opts ...grpc.CallOption) (*FetchWork, error)
	ReportFetchResult(ctx context.Context, in *FetchReport, opts ...grpc.CallOption) (*Empty, error)
}

ConfigClient is the client API for Config service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewConfigClient

func NewConfigClient(cc *grpc.ClientConn) ConfigClient

type ConfigServer

type ConfigServer interface {
	GetServeWork(context.Context, *ServeWorkRequest) (*ServeWork, error)
	GetFetchWork(context.Context, *FetchWorkRequest) (*FetchWork, error)
	ReportFetchResult(context.Context, *FetchReport) (*Empty, error)
}

ConfigServer is the server API for Config service.

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Empty is empty

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

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type FetchJob

type FetchJob struct {
	ID                   string   `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	URL                  string   `protobuf:"bytes,2,opt,name=URL,proto3" json:"URL,omitempty"`
	Store                string   `protobuf:"bytes,3,opt,name=store,proto3" json:"store,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

FetchJob tells a fetcher to do something.

func (*FetchJob) Descriptor

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

func (*FetchJob) GetID

func (m *FetchJob) GetID() string

func (*FetchJob) GetStore

func (m *FetchJob) GetStore() string

func (*FetchJob) GetURL

func (m *FetchJob) GetURL() string

func (*FetchJob) ProtoMessage

func (*FetchJob) ProtoMessage()

func (*FetchJob) Reset

func (m *FetchJob) Reset()

func (*FetchJob) String

func (m *FetchJob) String() string

func (*FetchJob) XXX_DiscardUnknown

func (m *FetchJob) XXX_DiscardUnknown()

func (*FetchJob) XXX_Marshal

func (m *FetchJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchJob) XXX_Merge

func (m *FetchJob) XXX_Merge(src proto.Message)

func (*FetchJob) XXX_Size

func (m *FetchJob) XXX_Size() int

func (*FetchJob) XXX_Unmarshal

func (m *FetchJob) XXX_Unmarshal(b []byte) error

type FetchReport

type FetchReport struct {
	ID                   string   `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Status               string   `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

FetchReport says how a fetch went

func (*FetchReport) Descriptor

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

func (*FetchReport) GetID

func (m *FetchReport) GetID() string

func (*FetchReport) GetStatus

func (m *FetchReport) GetStatus() string

func (*FetchReport) ProtoMessage

func (*FetchReport) ProtoMessage()

func (*FetchReport) Reset

func (m *FetchReport) Reset()

func (*FetchReport) String

func (m *FetchReport) String() string

func (*FetchReport) XXX_DiscardUnknown

func (m *FetchReport) XXX_DiscardUnknown()

func (*FetchReport) XXX_Marshal

func (m *FetchReport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchReport) XXX_Merge

func (m *FetchReport) XXX_Merge(src proto.Message)

func (*FetchReport) XXX_Size

func (m *FetchReport) XXX_Size() int

func (*FetchReport) XXX_Unmarshal

func (m *FetchReport) XXX_Unmarshal(b []byte) error

type FetchWork

type FetchWork struct {
	Jobs                 []*FetchJob `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

FetchWork tells a fetcher all its jobs.

func (*FetchWork) Descriptor

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

func (*FetchWork) GetJobs

func (m *FetchWork) GetJobs() []*FetchJob

func (*FetchWork) ProtoMessage

func (*FetchWork) ProtoMessage()

func (*FetchWork) Reset

func (m *FetchWork) Reset()

func (*FetchWork) String

func (m *FetchWork) String() string

func (*FetchWork) XXX_DiscardUnknown

func (m *FetchWork) XXX_DiscardUnknown()

func (*FetchWork) XXX_Marshal

func (m *FetchWork) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchWork) XXX_Merge

func (m *FetchWork) XXX_Merge(src proto.Message)

func (*FetchWork) XXX_Size

func (m *FetchWork) XXX_Size() int

func (*FetchWork) XXX_Unmarshal

func (m *FetchWork) XXX_Unmarshal(b []byte) error

type FetchWorkRequest

type FetchWorkRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

FetchWorkRequest requests serve work

func (*FetchWorkRequest) Descriptor

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

func (*FetchWorkRequest) ProtoMessage

func (*FetchWorkRequest) ProtoMessage()

func (*FetchWorkRequest) Reset

func (m *FetchWorkRequest) Reset()

func (*FetchWorkRequest) String

func (m *FetchWorkRequest) String() string

func (*FetchWorkRequest) XXX_DiscardUnknown

func (m *FetchWorkRequest) XXX_DiscardUnknown()

func (*FetchWorkRequest) XXX_Marshal

func (m *FetchWorkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchWorkRequest) XXX_Merge

func (m *FetchWorkRequest) XXX_Merge(src proto.Message)

func (*FetchWorkRequest) XXX_Size

func (m *FetchWorkRequest) XXX_Size() int

func (*FetchWorkRequest) XXX_Unmarshal

func (m *FetchWorkRequest) XXX_Unmarshal(b []byte) error

type OutputArticle

type OutputArticle struct {
	Source string    `json:"source"`
	ID     string    `json:"id"`
	Title  string    `json:"title"`
	Date   time.Time `json:"date"`
	Body   string    `json:"body"`
}

OutputArticle is how the frontend presents articles

type OutputFeed

type OutputFeed struct {
	Query    string          `json:"query"`
	Next     string          `json:"next"`
	Articles []OutputArticle `json:"articles"`
}

OutputFeed is how the frontend serves data.

type RestSource

type RestSource struct {
	ID     string           `json:"id"`
	Spec   RestSourceSpec   `json:"spec"`
	Status RestSourceStatus `json:"status"`
}

RestSource is a source as known by the config service

type RestSourceSpec

type RestSourceSpec struct {
	URL   string `json:"url"`
	Store string `json:"store"`
}

RestSourceSpec to put new sources into config server.

type RestSourceStatus

type RestSourceStatus struct {
	LastStatus string `json:"lastStatus"`
}

RestSourceStatus is how a source appears to be functioning

type RestSources

type RestSources struct {
	Sources []RestSource `json:"sources"`
}

RestSources is a list of sources

type ServeFeed

type ServeFeed struct {
	ID                   string   `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Store                string   `protobuf:"bytes,3,opt,name=store,proto3" json:"store,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ServeFeed defines a remote data source

func (*ServeFeed) Descriptor

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

func (*ServeFeed) GetID

func (m *ServeFeed) GetID() string

func (*ServeFeed) GetStore

func (m *ServeFeed) GetStore() string

func (*ServeFeed) ProtoMessage

func (*ServeFeed) ProtoMessage()

func (*ServeFeed) Reset

func (m *ServeFeed) Reset()

func (*ServeFeed) String

func (m *ServeFeed) String() string

func (*ServeFeed) XXX_DiscardUnknown

func (m *ServeFeed) XXX_DiscardUnknown()

func (*ServeFeed) XXX_Marshal

func (m *ServeFeed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServeFeed) XXX_Merge

func (m *ServeFeed) XXX_Merge(src proto.Message)

func (*ServeFeed) XXX_Size

func (m *ServeFeed) XXX_Size() int

func (*ServeFeed) XXX_Unmarshal

func (m *ServeFeed) XXX_Unmarshal(b []byte) error

type ServeWork

type ServeWork struct {
	Feeds                []*ServeFeed `protobuf:"bytes,1,rep,name=feeds,proto3" json:"feeds,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

ServeWork is a collection of data sources

func (*ServeWork) Descriptor

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

func (*ServeWork) GetFeeds

func (m *ServeWork) GetFeeds() []*ServeFeed

func (*ServeWork) ProtoMessage

func (*ServeWork) ProtoMessage()

func (*ServeWork) Reset

func (m *ServeWork) Reset()

func (*ServeWork) String

func (m *ServeWork) String() string

func (*ServeWork) XXX_DiscardUnknown

func (m *ServeWork) XXX_DiscardUnknown()

func (*ServeWork) XXX_Marshal

func (m *ServeWork) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServeWork) XXX_Merge

func (m *ServeWork) XXX_Merge(src proto.Message)

func (*ServeWork) XXX_Size

func (m *ServeWork) XXX_Size() int

func (*ServeWork) XXX_Unmarshal

func (m *ServeWork) XXX_Unmarshal(b []byte) error

type ServeWorkRequest

type ServeWorkRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ServeWorkRequest requests serve work

func (*ServeWorkRequest) Descriptor

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

func (*ServeWorkRequest) ProtoMessage

func (*ServeWorkRequest) ProtoMessage()

func (*ServeWorkRequest) Reset

func (m *ServeWorkRequest) Reset()

func (*ServeWorkRequest) String

func (m *ServeWorkRequest) String() string

func (*ServeWorkRequest) XXX_DiscardUnknown

func (m *ServeWorkRequest) XXX_DiscardUnknown()

func (*ServeWorkRequest) XXX_Marshal

func (m *ServeWorkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServeWorkRequest) XXX_Merge

func (m *ServeWorkRequest) XXX_Merge(src proto.Message)

func (*ServeWorkRequest) XXX_Size

func (m *ServeWorkRequest) XXX_Size() int

func (*ServeWorkRequest) XXX_Unmarshal

func (m *ServeWorkRequest) XXX_Unmarshal(b []byte) error

type Service

type Service interface {
	Start(context.Context) error
}

Service is a simple service

type StoreArticle

type StoreArticle struct {
	ID                   string   `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Title                string   `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Date                 int64    `protobuf:"varint,3,opt,name=date,proto3" json:"date,omitempty"`
	Body                 string   `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StoreArticle is an article in the store

func (*StoreArticle) Descriptor

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

func (*StoreArticle) GetBody

func (m *StoreArticle) GetBody() string

func (*StoreArticle) GetDate

func (m *StoreArticle) GetDate() int64

func (*StoreArticle) GetID

func (m *StoreArticle) GetID() string

func (*StoreArticle) GetTitle

func (m *StoreArticle) GetTitle() string

func (*StoreArticle) ProtoMessage

func (*StoreArticle) ProtoMessage()

func (*StoreArticle) Reset

func (m *StoreArticle) Reset()

func (*StoreArticle) String

func (m *StoreArticle) String() string

func (*StoreArticle) XXX_DiscardUnknown

func (m *StoreArticle) XXX_DiscardUnknown()

func (*StoreArticle) XXX_Marshal

func (m *StoreArticle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StoreArticle) XXX_Merge

func (m *StoreArticle) XXX_Merge(src proto.Message)

func (*StoreArticle) XXX_Size

func (m *StoreArticle) XXX_Size() int

func (*StoreArticle) XXX_Unmarshal

func (m *StoreArticle) XXX_Unmarshal(b []byte) error

type StoreClient

type StoreClient interface {
	PostFeed(ctx context.Context, in *StorePostFeedRequest, opts ...grpc.CallOption) (*StorePostFeedResponse, error)
	GetFeed(ctx context.Context, in *StoreGetFeedRequest, opts ...grpc.CallOption) (*StoreGetFeedResponse, error)
}

StoreClient is the client API for Store service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewStoreClient

func NewStoreClient(cc *grpc.ClientConn) StoreClient

type StoreGetFeedRequest

type StoreGetFeedRequest struct {
	FeedID               string   `protobuf:"bytes,1,opt,name=feedID,proto3" json:"feedID,omitempty"`
	Since                int64    `protobuf:"varint,2,opt,name=since,proto3" json:"since,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StoreGetFeedRequest is how to request articles from the store

func (*StoreGetFeedRequest) Descriptor

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

func (*StoreGetFeedRequest) GetFeedID

func (m *StoreGetFeedRequest) GetFeedID() string

func (*StoreGetFeedRequest) GetSince

func (m *StoreGetFeedRequest) GetSince() int64

func (*StoreGetFeedRequest) ProtoMessage

func (*StoreGetFeedRequest) ProtoMessage()

func (*StoreGetFeedRequest) Reset

func (m *StoreGetFeedRequest) Reset()

func (*StoreGetFeedRequest) String

func (m *StoreGetFeedRequest) String() string

func (*StoreGetFeedRequest) XXX_DiscardUnknown

func (m *StoreGetFeedRequest) XXX_DiscardUnknown()

func (*StoreGetFeedRequest) XXX_Marshal

func (m *StoreGetFeedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StoreGetFeedRequest) XXX_Merge

func (m *StoreGetFeedRequest) XXX_Merge(src proto.Message)

func (*StoreGetFeedRequest) XXX_Size

func (m *StoreGetFeedRequest) XXX_Size() int

func (*StoreGetFeedRequest) XXX_Unmarshal

func (m *StoreGetFeedRequest) XXX_Unmarshal(b []byte) error

type StoreGetFeedResponse

type StoreGetFeedResponse struct {
	Articles             []*StoreArticle `protobuf:"bytes,2,rep,name=articles,proto3" json:"articles,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

StoreGetFeedResponse is some articles from the store

func (*StoreGetFeedResponse) Descriptor

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

func (*StoreGetFeedResponse) GetArticles

func (m *StoreGetFeedResponse) GetArticles() []*StoreArticle

func (*StoreGetFeedResponse) ProtoMessage

func (*StoreGetFeedResponse) ProtoMessage()

func (*StoreGetFeedResponse) Reset

func (m *StoreGetFeedResponse) Reset()

func (*StoreGetFeedResponse) String

func (m *StoreGetFeedResponse) String() string

func (*StoreGetFeedResponse) XXX_DiscardUnknown

func (m *StoreGetFeedResponse) XXX_DiscardUnknown()

func (*StoreGetFeedResponse) XXX_Marshal

func (m *StoreGetFeedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StoreGetFeedResponse) XXX_Merge

func (m *StoreGetFeedResponse) XXX_Merge(src proto.Message)

func (*StoreGetFeedResponse) XXX_Size

func (m *StoreGetFeedResponse) XXX_Size() int

func (*StoreGetFeedResponse) XXX_Unmarshal

func (m *StoreGetFeedResponse) XXX_Unmarshal(b []byte) error

type StorePostFeedRequest

type StorePostFeedRequest struct {
	FeedID               string          `protobuf:"bytes,1,opt,name=feedID,proto3" json:"feedID,omitempty"`
	Articles             []*StoreArticle `protobuf:"bytes,2,rep,name=articles,proto3" json:"articles,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

StorePostFeedRequest is how to put articles into the store

func (*StorePostFeedRequest) Descriptor

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

func (*StorePostFeedRequest) GetArticles

func (m *StorePostFeedRequest) GetArticles() []*StoreArticle

func (*StorePostFeedRequest) GetFeedID

func (m *StorePostFeedRequest) GetFeedID() string

func (*StorePostFeedRequest) ProtoMessage

func (*StorePostFeedRequest) ProtoMessage()

func (*StorePostFeedRequest) Reset

func (m *StorePostFeedRequest) Reset()

func (*StorePostFeedRequest) String

func (m *StorePostFeedRequest) String() string

func (*StorePostFeedRequest) XXX_DiscardUnknown

func (m *StorePostFeedRequest) XXX_DiscardUnknown()

func (*StorePostFeedRequest) XXX_Marshal

func (m *StorePostFeedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StorePostFeedRequest) XXX_Merge

func (m *StorePostFeedRequest) XXX_Merge(src proto.Message)

func (*StorePostFeedRequest) XXX_Size

func (m *StorePostFeedRequest) XXX_Size() int

func (*StorePostFeedRequest) XXX_Unmarshal

func (m *StorePostFeedRequest) XXX_Unmarshal(b []byte) error

type StorePostFeedResponse

type StorePostFeedResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

StorePostFeedResponse is nothing

func (*StorePostFeedResponse) Descriptor

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

func (*StorePostFeedResponse) ProtoMessage

func (*StorePostFeedResponse) ProtoMessage()

func (*StorePostFeedResponse) Reset

func (m *StorePostFeedResponse) Reset()

func (*StorePostFeedResponse) String

func (m *StorePostFeedResponse) String() string

func (*StorePostFeedResponse) XXX_DiscardUnknown

func (m *StorePostFeedResponse) XXX_DiscardUnknown()

func (*StorePostFeedResponse) XXX_Marshal

func (m *StorePostFeedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StorePostFeedResponse) XXX_Merge

func (m *StorePostFeedResponse) XXX_Merge(src proto.Message)

func (*StorePostFeedResponse) XXX_Size

func (m *StorePostFeedResponse) XXX_Size() int

func (*StorePostFeedResponse) XXX_Unmarshal

func (m *StorePostFeedResponse) XXX_Unmarshal(b []byte) error

type StoreServer

StoreServer is the server API for Store service.

type UnimplementedConfigServer

type UnimplementedConfigServer struct {
}

UnimplementedConfigServer can be embedded to have forward compatible implementations.

func (*UnimplementedConfigServer) GetFetchWork

func (*UnimplementedConfigServer) GetServeWork

func (*UnimplementedConfigServer) ReportFetchResult

func (*UnimplementedConfigServer) ReportFetchResult(ctx context.Context, req *FetchReport) (*Empty, error)

type UnimplementedStoreServer

type UnimplementedStoreServer struct {
}

UnimplementedStoreServer can be embedded to have forward compatible implementations.

func (*UnimplementedStoreServer) GetFeed

func (*UnimplementedStoreServer) PostFeed

type UnimplementedUserServer

type UnimplementedUserServer struct {
}

UnimplementedUserServer can be embedded to have forward compatible implementations.

type UserClient

type UserClient interface {
}

UserClient is the client API for User service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewUserClient

func NewUserClient(cc *grpc.ClientConn) UserClient

type UserServer

type UserServer interface {
}

UserServer is the server API for User service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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