cds

package
v0.0.0-...-be2ef80 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cds is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_external_cds_cds_proto protoreflect.FileDescriptor

Functions

func RegisterCdsHandler

func RegisterCdsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCdsHandler registers the http handlers for service Cds to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCdsHandlerClient

func RegisterCdsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CdsClient) error

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

func RegisterCdsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CdsServer) error

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

func RegisterCdsServer(s *grpc.Server, srv CdsServer)

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) InstallContentItem

func (*UnimplementedCdsServer) IsContentEnabled

func (*UnimplementedCdsServer) ListContentItems

func (*UnimplementedCdsServer) SubmitCredentials

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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