Documentation ¶
Overview ¶
Package cds is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCdsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCdsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CdsClient) error
- func RegisterCdsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCdsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CdsServer) error
- func RegisterCdsServer(s *grpc.Server, srv CdsServer)
- type CdsClient
- type CdsServer
- type Cds_DownloadContentItemClient
- type Cds_DownloadContentItemServer
- type UnimplementedCdsServer
- func (*UnimplementedCdsServer) DownloadContentItem(*request.DownloadContentItem, Cds_DownloadContentItemServer) error
- func (*UnimplementedCdsServer) InstallContentItem(context.Context, *request.InstallContentItem) (*response.InstallContentItem, error)
- func (*UnimplementedCdsServer) IsContentEnabled(context.Context, *request.ContentEnabled) (*response.ContentEnabled, error)
- func (*UnimplementedCdsServer) ListContentItems(context.Context, *request.ContentItems) (*response.ContentItems, error)
- func (*UnimplementedCdsServer) SubmitCredentials(context.Context, *request.Credentials) (*response.Credentials, error)
Constants ¶
This section is empty.
Variables ¶
var File_external_cds_cds_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCdsHandler ¶
RegisterCdsHandler registers the http handlers for service Cds to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCdsHandlerClient ¶
RegisterCdsHandlerClient registers the http handlers for service Cds to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CdsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CdsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CdsClient" to call the correct interceptors.
func RegisterCdsHandlerFromEndpoint ¶
func RegisterCdsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCdsHandlerFromEndpoint is same as RegisterCdsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCdsHandlerServer ¶
RegisterCdsHandlerServer registers the http handlers for service Cds to "mux". UnaryRPC :call CdsServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterCdsServer ¶
Types ¶
type CdsClient ¶
type CdsClient interface { // ListContentItems // // Returns a list of metadata for each CDS content. Provides a description and current // state of each content item. // // Authorization Action: // “` // “` // //content:items:list ListContentItems(ctx context.Context, in *request.ContentItems, opts ...grpc.CallOption) (*response.ContentItems, error) // SubmitCredentials // // # Submit a Chef Cloud Credentials to enable content // // Authorization Action: // “` // “` // //content:credentials:add SubmitCredentials(ctx context.Context, in *request.Credentials, opts ...grpc.CallOption) (*response.Credentials, error) // IsContentEnabled // // Check if the content is enable for this Automate instance. // // Authorization Action: // “` // “` // //content:credentials:enabled IsContentEnabled(ctx context.Context, in *request.ContentEnabled, opts ...grpc.CallOption) (*response.ContentEnabled, error) // InstallContentItem // // # Installs a content item from its ID // // Authorization Action: // “` // “` // //content:items:install InstallContentItem(ctx context.Context, in *request.InstallContentItem, opts ...grpc.CallOption) (*response.InstallContentItem, error) // DownloadContentItem // // # Download a content item from its ID // // grpc gateway is not able to handle streaming; https://github.com/grpc-ecosystem/grpc-gateway/issues/435 // so we do not auto-generate the route for download; we instead custom handle with mux // // Authorization Action: // “` // “` // //content:items:download DownloadContentItem(ctx context.Context, in *request.DownloadContentItem, opts ...grpc.CallOption) (Cds_DownloadContentItemClient, error) }
CdsClient is the client API for Cds service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCdsClient ¶
func NewCdsClient(cc grpc.ClientConnInterface) CdsClient
type CdsServer ¶
type CdsServer interface { // ListContentItems // // Returns a list of metadata for each CDS content. Provides a description and current // state of each content item. // // Authorization Action: // “` // “` // //content:items:list ListContentItems(context.Context, *request.ContentItems) (*response.ContentItems, error) // SubmitCredentials // // # Submit a Chef Cloud Credentials to enable content // // Authorization Action: // “` // “` // //content:credentials:add SubmitCredentials(context.Context, *request.Credentials) (*response.Credentials, error) // IsContentEnabled // // Check if the content is enable for this Automate instance. // // Authorization Action: // “` // “` // //content:credentials:enabled IsContentEnabled(context.Context, *request.ContentEnabled) (*response.ContentEnabled, error) // InstallContentItem // // # Installs a content item from its ID // // Authorization Action: // “` // “` // //content:items:install InstallContentItem(context.Context, *request.InstallContentItem) (*response.InstallContentItem, error) // DownloadContentItem // // # Download a content item from its ID // // grpc gateway is not able to handle streaming; https://github.com/grpc-ecosystem/grpc-gateway/issues/435 // so we do not auto-generate the route for download; we instead custom handle with mux // // Authorization Action: // “` // “` // //content:items:download DownloadContentItem(*request.DownloadContentItem, Cds_DownloadContentItemServer) error }
CdsServer is the server API for Cds service.
type Cds_DownloadContentItemClient ¶
type Cds_DownloadContentItemClient interface { Recv() (*common.ExportData, error) grpc.ClientStream }
type Cds_DownloadContentItemServer ¶
type Cds_DownloadContentItemServer interface { Send(*common.ExportData) error grpc.ServerStream }
type UnimplementedCdsServer ¶
type UnimplementedCdsServer struct { }
UnimplementedCdsServer can be embedded to have forward compatible implementations.
func (*UnimplementedCdsServer) DownloadContentItem ¶
func (*UnimplementedCdsServer) DownloadContentItem(*request.DownloadContentItem, Cds_DownloadContentItemServer) error
func (*UnimplementedCdsServer) InstallContentItem ¶
func (*UnimplementedCdsServer) InstallContentItem(context.Context, *request.InstallContentItem) (*response.InstallContentItem, error)
func (*UnimplementedCdsServer) IsContentEnabled ¶
func (*UnimplementedCdsServer) IsContentEnabled(context.Context, *request.ContentEnabled) (*response.ContentEnabled, error)
func (*UnimplementedCdsServer) ListContentItems ¶
func (*UnimplementedCdsServer) ListContentItems(context.Context, *request.ContentItems) (*response.ContentItems, error)
func (*UnimplementedCdsServer) SubmitCredentials ¶
func (*UnimplementedCdsServer) SubmitCredentials(context.Context, *request.Credentials) (*response.Credentials, error)