Documentation
¶
Overview ¶
Package service NOTES
Index ¶
- func FeedStreamAuthInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func FeedUnaryAuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func FeedUnaryUpdateLastConsumedTimeInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- type ErrorResponse
- type Service
- func (s *Service) AsyncDownload(ctx context.Context, req *pbfs.AsyncDownloadReq) (*pbfs.AsyncDownloadResp, error)
- func (s *Service) AsyncDownloadStatus(ctx context.Context, req *pbfs.AsyncDownloadStatusReq) (*pbfs.AsyncDownloadStatusResp, error)
- func (s *Service) DownloadFile(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetDownloadURL(ctx context.Context, req *pbfs.GetDownloadURLReq) (*pbfs.GetDownloadURLResp, error)
- func (s *Service) GetKvValue(ctx context.Context, req *pbfs.GetKvValueReq) (*pbfs.GetKvValueResp, error)
- func (s *Service) GetSingleFileContent(req *pbfs.GetSingleFileContentReq, ...) error
- func (s *Service) GetSingleKvMeta(ctx context.Context, req *pbfs.GetSingleKvValueReq) (*pbfs.GetSingleKvMetaResp, error)
- func (s *Service) GetSingleKvValue(ctx context.Context, req *pbfs.GetSingleKvValueReq) (*pbfs.GetSingleKvValueResp, error)
- func (s *Service) Handshake(ctx context.Context, hm *pbfs.HandshakeMessage) (*pbfs.HandshakeResp, error)
- func (s *Service) HealthyHandler(w http.ResponseWriter, r *http.Request)
- func (s *Service) Healthz(w http.ResponseWriter, req *http.Request)
- func (s *Service) ListApps(ctx context.Context, req *pbfs.ListAppsReq) (*pbfs.ListAppsResp, error)
- func (s *Service) ListFileAppLatestReleaseMetaRest(r *http.Request) (interface{}, error)
- func (s *Service) ListenAndGwServerRest() error
- func (s *Service) ListenAndServeRest() error
- func (s *Service) Messaging(ctx context.Context, msg *pbfs.MessagingMeta) (*pbfs.MessagingResp, error)
- func (s *Service) PullAppFileMeta(ctx context.Context, req *pbfs.PullAppFileMetaReq) (*pbfs.PullAppFileMetaResp, error)
- func (s *Service) PullKvMeta(ctx context.Context, req *pbfs.PullKvMetaReq) (*pbfs.PullKvMetaResp, error)
- func (s *Service) ReadyHandler(w http.ResponseWriter, r *http.Request)
- func (s *Service) UpdateLastConsumedTime(next http.Handler) http.Handler
- func (s *Service) Watch(swm *pbfs.SideWatchMeta, fws pbfs.Upstream_WatchServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FeedStreamAuthInterceptor ¶
func FeedStreamAuthInterceptor( srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
FeedStreamAuthInterceptor feed 鉴权中间件
func FeedUnaryAuthInterceptor ¶
func FeedUnaryAuthInterceptor( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
FeedUnaryAuthInterceptor feed 鉴权中间件
func FeedUnaryUpdateLastConsumedTimeInterceptor ¶
func FeedUnaryUpdateLastConsumedTimeInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
FeedUnaryUpdateLastConsumedTimeInterceptor feed 更新拉取时间中间件
Types ¶
type ErrorResponse ¶
ErrorResponse 定义错误响应结构
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service do all the data service's work
func NewService ¶
NewService create a service instance.
func (*Service) AsyncDownload ¶
func (s *Service) AsyncDownload(ctx context.Context, req *pbfs.AsyncDownloadReq) (*pbfs.AsyncDownloadResp, error)
AsyncDownload 异步 p2p 下载,文件名为 sha256
func (*Service) AsyncDownloadStatus ¶
func (s *Service) AsyncDownloadStatus(ctx context.Context, req *pbfs.AsyncDownloadStatusReq) ( *pbfs.AsyncDownloadStatusResp, error)
AsyncDownloadStatus 查询异步 p2p 下载任务状态
func (*Service) DownloadFile ¶
func (s *Service) DownloadFile(w http.ResponseWriter, r *http.Request)
DownloadFile download file from provider repo nolint:funlen
func (*Service) GetDownloadURL ¶
func (s *Service) GetDownloadURL(ctx context.Context, req *pbfs.GetDownloadURLReq) ( *pbfs.GetDownloadURLResp, error)
GetDownloadURL get the download url of the file.
func (*Service) GetKvValue ¶
func (s *Service) GetKvValue(ctx context.Context, req *pbfs.GetKvValueReq) (*pbfs.GetKvValueResp, error)
GetKvValue get kv value
func (*Service) GetSingleFileContent ¶
func (s *Service) GetSingleFileContent(req *pbfs.GetSingleFileContentReq, stream pbfs.Upstream_GetSingleFileContentServer) error
GetSingleFileContent 获取单文件内容 nolint:funlen
func (*Service) GetSingleKvMeta ¶
func (s *Service) GetSingleKvMeta(ctx context.Context, req *pbfs.GetSingleKvValueReq) ( *pbfs.GetSingleKvMetaResp, error)
GetSingleKvMeta 获取单个kv mate data
func (*Service) GetSingleKvValue ¶
func (s *Service) GetSingleKvValue(ctx context.Context, req *pbfs.GetSingleKvValueReq) ( *pbfs.GetSingleKvValueResp, error)
GetSingleKvValue 获取单个kv
func (*Service) Handshake ¶
func (s *Service) Handshake(ctx context.Context, hm *pbfs.HandshakeMessage) (*pbfs.HandshakeResp, error)
Handshake received handshake from sidecar to validate the app instance's authorization and legality.
func (*Service) HealthyHandler ¶
func (s *Service) HealthyHandler(w http.ResponseWriter, r *http.Request)
HealthyHandler livenessProbe 健康检查
func (*Service) Healthz ¶
func (s *Service) Healthz(w http.ResponseWriter, req *http.Request)
Healthz check whether the service is healthy.
func (*Service) ListApps ¶
func (s *Service) ListApps(ctx context.Context, req *pbfs.ListAppsReq) (*pbfs.ListAppsResp, error)
ListApps 获取服务列表
func (*Service) ListFileAppLatestReleaseMetaRest ¶
ListFileAppLatestReleaseMetaRest list an app's latest release metadata only when the app's configures is file type.
func (*Service) ListenAndGwServerRest ¶
ListenAndGwServerRest listen and grpc-gateway serve the restful server
func (*Service) ListenAndServeRest ¶
ListenAndServeRest listen and serve the restful server
func (*Service) Messaging ¶
func (s *Service) Messaging(ctx context.Context, msg *pbfs.MessagingMeta) (*pbfs.MessagingResp, error)
Messaging received messages delivered from sidecar. nolint:funlen
func (*Service) PullAppFileMeta ¶
func (s *Service) PullAppFileMeta(ctx context.Context, req *pbfs.PullAppFileMetaReq) ( *pbfs.PullAppFileMetaResp, error)
PullAppFileMeta pull an app's latest release metadata only when the app's configures is file type. nolint:funlen
func (*Service) PullKvMeta ¶
func (s *Service) PullKvMeta(ctx context.Context, req *pbfs.PullKvMetaReq) (*pbfs.PullKvMetaResp, error)
PullKvMeta pull an app's latest release metadata only when the app's configures is kv type.
func (*Service) ReadyHandler ¶
func (s *Service) ReadyHandler(w http.ResponseWriter, r *http.Request)
ReadyHandler ReadinessProbe 健康检查
func (*Service) UpdateLastConsumedTime ¶
UpdateLastConsumedTime 更新服务拉取时间中间件
func (*Service) Watch ¶
func (s *Service) Watch(swm *pbfs.SideWatchMeta, fws pbfs.Upstream_WatchServer) error
Watch the change message from feed server for sidecar.