template

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package template is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTemplateHandler

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

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

func RegisterTemplateHandlerClient

func RegisterTemplateHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TemplateClient) error

RegisterTemplateHandlerClient registers the http handlers for service Template to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TemplateClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TemplateClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TemplateClient" to call the correct interceptors.

func RegisterTemplateHandlerFromEndpoint

func RegisterTemplateHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTemplateHandlerFromEndpoint is same as RegisterTemplateHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTemplateHandlerServer

func RegisterTemplateHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TemplateServer) error

RegisterTemplateHandlerServer registers the http handlers for service Template to "mux". UnaryRPC :call TemplateServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterTemplateServer

func RegisterTemplateServer(s *grpc.Server, srv TemplateServer)

Types

type CreateResponse

type CreateResponse struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreateResponse) Descriptor

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

func (*CreateResponse) GetId

func (m *CreateResponse) GetId() string

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) Reset

func (m *CreateResponse) Reset()

func (*CreateResponse) String

func (m *CreateResponse) String() string

func (*CreateResponse) XXX_DiscardUnknown

func (m *CreateResponse) XXX_DiscardUnknown()

func (*CreateResponse) XXX_Marshal

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

func (*CreateResponse) XXX_Merge

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

func (*CreateResponse) XXX_Size

func (m *CreateResponse) XXX_Size() int

func (*CreateResponse) XXX_Unmarshal

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

type Empty

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

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 GetRequest

type GetRequest struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetRequest) Descriptor

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

func (*GetRequest) GetId

func (m *GetRequest) GetId() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

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

func (*GetRequest) XXX_Merge

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

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

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

type TemplateClient

type TemplateClient interface {
	CreateTemplate(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*CreateResponse, error)
	GetTemplate(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
	DeleteTemplate(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Empty, error)
	ListTemplates(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Template_ListTemplatesClient, error)
	UpdateTemplate(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*Empty, error)
}

TemplateClient is the client API for Template service.

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

func NewTemplateClient

func NewTemplateClient(cc grpc.ClientConnInterface) TemplateClient

type TemplateServer

type TemplateServer interface {
	CreateTemplate(context.Context, *WorkflowTemplate) (*CreateResponse, error)
	GetTemplate(context.Context, *GetRequest) (*WorkflowTemplate, error)
	DeleteTemplate(context.Context, *GetRequest) (*Empty, error)
	ListTemplates(*Empty, Template_ListTemplatesServer) error
	UpdateTemplate(context.Context, *WorkflowTemplate) (*Empty, error)
}

TemplateServer is the server API for Template service.

type Template_ListTemplatesClient

type Template_ListTemplatesClient interface {
	Recv() (*WorkflowTemplate, error)
	grpc.ClientStream
}

type Template_ListTemplatesServer

type Template_ListTemplatesServer interface {
	Send(*WorkflowTemplate) error
	grpc.ServerStream
}

type UnimplementedTemplateServer

type UnimplementedTemplateServer struct {
}

UnimplementedTemplateServer can be embedded to have forward compatible implementations.

func (*UnimplementedTemplateServer) CreateTemplate

func (*UnimplementedTemplateServer) DeleteTemplate

func (*UnimplementedTemplateServer) DeleteTemplate(ctx context.Context, req *GetRequest) (*Empty, error)

func (*UnimplementedTemplateServer) GetTemplate

func (*UnimplementedTemplateServer) ListTemplates

func (*UnimplementedTemplateServer) UpdateTemplate

func (*UnimplementedTemplateServer) UpdateTemplate(ctx context.Context, req *WorkflowTemplate) (*Empty, error)

type WorkflowTemplate

type WorkflowTemplate struct {
	Id                   string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string               `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	CreatedAt            *timestamp.Timestamp `protobuf:"bytes,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
	UpdatedAt            *timestamp.Timestamp `protobuf:"bytes,5,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
	DeletedAt            *timestamp.Timestamp `protobuf:"bytes,6,opt,name=deletedAt,proto3" json:"deletedAt,omitempty"`
	Data                 string               `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*WorkflowTemplate) Descriptor

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

func (*WorkflowTemplate) GetCreatedAt

func (m *WorkflowTemplate) GetCreatedAt() *timestamp.Timestamp

func (*WorkflowTemplate) GetData

func (m *WorkflowTemplate) GetData() string

func (*WorkflowTemplate) GetDeletedAt

func (m *WorkflowTemplate) GetDeletedAt() *timestamp.Timestamp

func (*WorkflowTemplate) GetId

func (m *WorkflowTemplate) GetId() string

func (*WorkflowTemplate) GetName

func (m *WorkflowTemplate) GetName() string

func (*WorkflowTemplate) GetUpdatedAt

func (m *WorkflowTemplate) GetUpdatedAt() *timestamp.Timestamp

func (*WorkflowTemplate) ProtoMessage

func (*WorkflowTemplate) ProtoMessage()

func (*WorkflowTemplate) Reset

func (m *WorkflowTemplate) Reset()

func (*WorkflowTemplate) String

func (m *WorkflowTemplate) String() string

func (*WorkflowTemplate) XXX_DiscardUnknown

func (m *WorkflowTemplate) XXX_DiscardUnknown()

func (*WorkflowTemplate) XXX_Marshal

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

func (*WorkflowTemplate) XXX_Merge

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

func (*WorkflowTemplate) XXX_Size

func (m *WorkflowTemplate) XXX_Size() int

func (*WorkflowTemplate) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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