template

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_protos_template_template_proto protoreflect.FileDescriptor
View Source
var TemplateService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "github.com.tinkerbell.tink.protos.template.TemplateService",
	HandlerType: (*TemplateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateTemplate",
			Handler:    _TemplateService_CreateTemplate_Handler,
		},
		{
			MethodName: "GetTemplate",
			Handler:    _TemplateService_GetTemplate_Handler,
		},
		{
			MethodName: "DeleteTemplate",
			Handler:    _TemplateService_DeleteTemplate_Handler,
		},
		{
			MethodName: "UpdateTemplate",
			Handler:    _TemplateService_UpdateTemplate_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListTemplates",
			Handler:       _TemplateService_ListTemplates_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "protos/template/template.proto",
}

TemplateService_ServiceDesc is the grpc.ServiceDesc for TemplateService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTemplateServiceServer added in v0.2.0

func RegisterTemplateServiceServer(s grpc.ServiceRegistrar, srv TemplateServiceServer)

Types

type CreateResponse

type CreateResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

CreateResponse returns the ID of the created template

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetId

func (x *CreateResponse) GetId() string

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect added in v0.2.0

func (x *CreateResponse) ProtoReflect() protoreflect.Message

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

Empty represents an empty response

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect added in v0.2.0

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type GetRequest

type GetRequest struct {

	// Types that are assignable to GetBy:
	//	*GetRequest_Id
	//	*GetRequest_Name
	GetBy isGetRequest_GetBy `protobuf_oneof:"get_by"`
	// contains filtered or unexported fields
}

GetRequest enables you to filter templates by name or id.

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetGetBy added in v0.2.0

func (m *GetRequest) GetGetBy() isGetRequest_GetBy

func (*GetRequest) GetId

func (x *GetRequest) GetId() string

func (*GetRequest) GetName added in v0.2.0

func (x *GetRequest) GetName() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect added in v0.2.0

func (x *GetRequest) ProtoReflect() protoreflect.Message

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetRequest_Id added in v0.2.0

type GetRequest_Id struct {
	//
	// Filter by the template id
	Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"`
}

type GetRequest_Name added in v0.2.0

type GetRequest_Name struct {
	//
	// Filter by the template name
	Name string `protobuf:"bytes,2,opt,name=name,proto3,oneof"`
}

type ListRequest added in v0.2.0

type ListRequest struct {

	// Types that are assignable to FilterBy:
	//	*ListRequest_Name
	FilterBy isListRequest_FilterBy `protobuf_oneof:"filter_by"`
	// contains filtered or unexported fields
}

The request to use during a List template request

func (*ListRequest) Descriptor deprecated added in v0.2.0

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetFilterBy added in v0.2.0

func (m *ListRequest) GetFilterBy() isListRequest_FilterBy

func (*ListRequest) GetName added in v0.2.0

func (x *ListRequest) GetName() string

func (*ListRequest) ProtoMessage added in v0.2.0

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect added in v0.2.0

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset added in v0.2.0

func (x *ListRequest) Reset()

func (*ListRequest) String added in v0.2.0

func (x *ListRequest) String() string

type ListRequest_Name added in v0.2.0

type ListRequest_Name struct {
	//
	// Filter by the template name
	Name string `protobuf:"bytes,1,opt,name=name,proto3,oneof"`
}

type TemplateServiceClient added in v0.2.0

type TemplateServiceClient interface {
	//
	// CreateTemplate stores a template in the Tinkerbell server.
	CreateTemplate(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*CreateResponse, error)
	//
	// GetTemplate returns a specific template via its identifier.
	GetTemplate(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
	//
	// DeleteTemplate deletes a template via its identifier.
	DeleteTemplate(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Empty, error)
	//
	// ListTemplates returns all the template stored in Tinkerbell server
	ListTemplates(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (TemplateService_ListTemplatesClient, error)
	//
	// UpdateTemplate updates a template
	// TODO: Read the code and figure out how an update work
	UpdateTemplate(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*Empty, error)
}

TemplateServiceClient is the client API for TemplateService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTemplateServiceClient added in v0.2.0

func NewTemplateServiceClient(cc grpc.ClientConnInterface) TemplateServiceClient

type TemplateServiceClientMock added in v0.5.0

type TemplateServiceClientMock struct {
	// CreateTemplateFunc mocks the CreateTemplate method.
	CreateTemplateFunc func(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*CreateResponse, error)

	// DeleteTemplateFunc mocks the DeleteTemplate method.
	DeleteTemplateFunc func(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Empty, error)

	// GetTemplateFunc mocks the GetTemplate method.
	GetTemplateFunc func(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)

	// ListTemplatesFunc mocks the ListTemplates method.
	ListTemplatesFunc func(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (TemplateService_ListTemplatesClient, error)

	// UpdateTemplateFunc mocks the UpdateTemplate method.
	UpdateTemplateFunc func(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*Empty, error)
	// contains filtered or unexported fields
}

TemplateServiceClientMock is a mock implementation of TemplateServiceClient.

func TestSomethingThatUsesTemplateServiceClient(t *testing.T) {

	// make and configure a mocked TemplateServiceClient
	mockedTemplateServiceClient := &TemplateServiceClientMock{
		CreateTemplateFunc: func(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*CreateResponse, error) {
			panic("mock out the CreateTemplate method")
		},
		DeleteTemplateFunc: func(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Empty, error) {
			panic("mock out the DeleteTemplate method")
		},
		GetTemplateFunc: func(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error) {
			panic("mock out the GetTemplate method")
		},
		ListTemplatesFunc: func(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (TemplateService_ListTemplatesClient, error) {
			panic("mock out the ListTemplates method")
		},
		UpdateTemplateFunc: func(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*Empty, error) {
			panic("mock out the UpdateTemplate method")
		},
	}

	// use mockedTemplateServiceClient in code that requires TemplateServiceClient
	// and then make assertions.

}

func (*TemplateServiceClientMock) CreateTemplate added in v0.5.0

func (mock *TemplateServiceClientMock) CreateTemplate(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*CreateResponse, error)

CreateTemplate calls CreateTemplateFunc.

func (*TemplateServiceClientMock) CreateTemplateCalls added in v0.5.0

func (mock *TemplateServiceClientMock) CreateTemplateCalls() []struct {
	Ctx  context.Context
	In   *WorkflowTemplate
	Opts []grpc.CallOption
}

CreateTemplateCalls gets all the calls that were made to CreateTemplate. Check the length with:

len(mockedTemplateServiceClient.CreateTemplateCalls())

func (*TemplateServiceClientMock) DeleteTemplate added in v0.5.0

func (mock *TemplateServiceClientMock) DeleteTemplate(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Empty, error)

DeleteTemplate calls DeleteTemplateFunc.

func (*TemplateServiceClientMock) DeleteTemplateCalls added in v0.5.0

func (mock *TemplateServiceClientMock) DeleteTemplateCalls() []struct {
	Ctx  context.Context
	In   *GetRequest
	Opts []grpc.CallOption
}

DeleteTemplateCalls gets all the calls that were made to DeleteTemplate. Check the length with:

len(mockedTemplateServiceClient.DeleteTemplateCalls())

func (*TemplateServiceClientMock) GetTemplate added in v0.5.0

func (mock *TemplateServiceClientMock) GetTemplate(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)

GetTemplate calls GetTemplateFunc.

func (*TemplateServiceClientMock) GetTemplateCalls added in v0.5.0

func (mock *TemplateServiceClientMock) GetTemplateCalls() []struct {
	Ctx  context.Context
	In   *GetRequest
	Opts []grpc.CallOption
}

GetTemplateCalls gets all the calls that were made to GetTemplate. Check the length with:

len(mockedTemplateServiceClient.GetTemplateCalls())

func (*TemplateServiceClientMock) ListTemplates added in v0.5.0

ListTemplates calls ListTemplatesFunc.

func (*TemplateServiceClientMock) ListTemplatesCalls added in v0.5.0

func (mock *TemplateServiceClientMock) ListTemplatesCalls() []struct {
	Ctx  context.Context
	In   *ListRequest
	Opts []grpc.CallOption
}

ListTemplatesCalls gets all the calls that were made to ListTemplates. Check the length with:

len(mockedTemplateServiceClient.ListTemplatesCalls())

func (*TemplateServiceClientMock) UpdateTemplate added in v0.5.0

func (mock *TemplateServiceClientMock) UpdateTemplate(ctx context.Context, in *WorkflowTemplate, opts ...grpc.CallOption) (*Empty, error)

UpdateTemplate calls UpdateTemplateFunc.

func (*TemplateServiceClientMock) UpdateTemplateCalls added in v0.5.0

func (mock *TemplateServiceClientMock) UpdateTemplateCalls() []struct {
	Ctx  context.Context
	In   *WorkflowTemplate
	Opts []grpc.CallOption
}

UpdateTemplateCalls gets all the calls that were made to UpdateTemplate. Check the length with:

len(mockedTemplateServiceClient.UpdateTemplateCalls())

type TemplateServiceServer added in v0.2.0

type TemplateServiceServer interface {
	//
	// CreateTemplate stores a template in the Tinkerbell server.
	CreateTemplate(context.Context, *WorkflowTemplate) (*CreateResponse, error)
	//
	// GetTemplate returns a specific template via its identifier.
	GetTemplate(context.Context, *GetRequest) (*WorkflowTemplate, error)
	//
	// DeleteTemplate deletes a template via its identifier.
	DeleteTemplate(context.Context, *GetRequest) (*Empty, error)
	//
	// ListTemplates returns all the template stored in Tinkerbell server
	ListTemplates(*ListRequest, TemplateService_ListTemplatesServer) error
	//
	// UpdateTemplate updates a template
	// TODO: Read the code and figure out how an update work
	UpdateTemplate(context.Context, *WorkflowTemplate) (*Empty, error)
}

TemplateServiceServer is the server API for TemplateService service. All implementations should embed UnimplementedTemplateServiceServer for forward compatibility

type TemplateService_ListTemplatesClient added in v0.2.0

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

type TemplateService_ListTemplatesClientMock added in v0.5.0

type TemplateService_ListTemplatesClientMock struct {
	// CloseSendFunc mocks the CloseSend method.
	CloseSendFunc func() error

	// ContextFunc mocks the Context method.
	ContextFunc func() context.Context

	// HeaderFunc mocks the Header method.
	HeaderFunc func() (metadata.MD, error)

	// RecvFunc mocks the Recv method.
	RecvFunc func() (*WorkflowTemplate, error)

	// RecvMsgFunc mocks the RecvMsg method.
	RecvMsgFunc func(m interface{}) error

	// SendMsgFunc mocks the SendMsg method.
	SendMsgFunc func(m interface{}) error

	// TrailerFunc mocks the Trailer method.
	TrailerFunc func() metadata.MD
	// contains filtered or unexported fields
}

TemplateService_ListTemplatesClientMock is a mock implementation of TemplateService_ListTemplatesClient.

func TestSomethingThatUsesTemplateService_ListTemplatesClient(t *testing.T) {

	// make and configure a mocked TemplateService_ListTemplatesClient
	mockedTemplateService_ListTemplatesClient := &TemplateService_ListTemplatesClientMock{
		CloseSendFunc: func() error {
			panic("mock out the CloseSend method")
		},
		ContextFunc: func() context.Context {
			panic("mock out the Context method")
		},
		HeaderFunc: func() (metadata.MD, error) {
			panic("mock out the Header method")
		},
		RecvFunc: func() (*WorkflowTemplate, error) {
			panic("mock out the Recv method")
		},
		RecvMsgFunc: func(m interface{}) error {
			panic("mock out the RecvMsg method")
		},
		SendMsgFunc: func(m interface{}) error {
			panic("mock out the SendMsg method")
		},
		TrailerFunc: func() metadata.MD {
			panic("mock out the Trailer method")
		},
	}

	// use mockedTemplateService_ListTemplatesClient in code that requires TemplateService_ListTemplatesClient
	// and then make assertions.

}

func (*TemplateService_ListTemplatesClientMock) CloseSend added in v0.5.0

CloseSend calls CloseSendFunc.

func (*TemplateService_ListTemplatesClientMock) CloseSendCalls added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) CloseSendCalls() []struct{}

CloseSendCalls gets all the calls that were made to CloseSend. Check the length with:

len(mockedTemplateService_ListTemplatesClient.CloseSendCalls())

func (*TemplateService_ListTemplatesClientMock) Context added in v0.5.0

Context calls ContextFunc.

func (*TemplateService_ListTemplatesClientMock) ContextCalls added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) ContextCalls() []struct{}

ContextCalls gets all the calls that were made to Context. Check the length with:

len(mockedTemplateService_ListTemplatesClient.ContextCalls())

func (*TemplateService_ListTemplatesClientMock) Header added in v0.5.0

Header calls HeaderFunc.

func (*TemplateService_ListTemplatesClientMock) HeaderCalls added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) HeaderCalls() []struct{}

HeaderCalls gets all the calls that were made to Header. Check the length with:

len(mockedTemplateService_ListTemplatesClient.HeaderCalls())

func (*TemplateService_ListTemplatesClientMock) Recv added in v0.5.0

Recv calls RecvFunc.

func (*TemplateService_ListTemplatesClientMock) RecvCalls added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) RecvCalls() []struct{}

RecvCalls gets all the calls that were made to Recv. Check the length with:

len(mockedTemplateService_ListTemplatesClient.RecvCalls())

func (*TemplateService_ListTemplatesClientMock) RecvMsg added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) RecvMsg(m interface{}) error

RecvMsg calls RecvMsgFunc.

func (*TemplateService_ListTemplatesClientMock) RecvMsgCalls added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) RecvMsgCalls() []struct {
	M interface{}
}

RecvMsgCalls gets all the calls that were made to RecvMsg. Check the length with:

len(mockedTemplateService_ListTemplatesClient.RecvMsgCalls())

func (*TemplateService_ListTemplatesClientMock) SendMsg added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) SendMsg(m interface{}) error

SendMsg calls SendMsgFunc.

func (*TemplateService_ListTemplatesClientMock) SendMsgCalls added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) SendMsgCalls() []struct {
	M interface{}
}

SendMsgCalls gets all the calls that were made to SendMsg. Check the length with:

len(mockedTemplateService_ListTemplatesClient.SendMsgCalls())

func (*TemplateService_ListTemplatesClientMock) Trailer added in v0.5.0

Trailer calls TrailerFunc.

func (*TemplateService_ListTemplatesClientMock) TrailerCalls added in v0.5.0

func (mock *TemplateService_ListTemplatesClientMock) TrailerCalls() []struct{}

TrailerCalls gets all the calls that were made to Trailer. Check the length with:

len(mockedTemplateService_ListTemplatesClient.TrailerCalls())

type TemplateService_ListTemplatesServer added in v0.2.0

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

type UnimplementedTemplateServiceServer added in v0.2.0

type UnimplementedTemplateServiceServer struct{}

UnimplementedTemplateServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedTemplateServiceServer) CreateTemplate added in v0.2.0

func (UnimplementedTemplateServiceServer) DeleteTemplate added in v0.2.0

func (UnimplementedTemplateServiceServer) GetTemplate added in v0.2.0

func (UnimplementedTemplateServiceServer) ListTemplates added in v0.2.0

func (UnimplementedTemplateServiceServer) UpdateTemplate added in v0.2.0

type UnsafeTemplateServiceServer added in v0.7.0

type UnsafeTemplateServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeTemplateServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TemplateServiceServer will result in compilation errors.

type WorkflowTemplate

type WorkflowTemplate struct {

	//
	// The template identifier
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	//
	// The name of the template. You can see it as a friendly way to remember a
	// template
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	//
	// When a template got created
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	//
	// The last time a template was modified
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	//
	// When a template got deleted. This is the value used to identify a deleted
	// template as well. If empty the template can be used to generate workflows.
	DeletedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"`
	//
	// The content of the template in its YAML representation
	Data string `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

WorkflowTemplate describes the template itself.

func (*WorkflowTemplate) Descriptor deprecated

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

Deprecated: Use WorkflowTemplate.ProtoReflect.Descriptor instead.

func (*WorkflowTemplate) GetCreatedAt

func (x *WorkflowTemplate) GetCreatedAt() *timestamppb.Timestamp

func (*WorkflowTemplate) GetData

func (x *WorkflowTemplate) GetData() string

func (*WorkflowTemplate) GetDeletedAt

func (x *WorkflowTemplate) GetDeletedAt() *timestamppb.Timestamp

func (*WorkflowTemplate) GetId

func (x *WorkflowTemplate) GetId() string

func (*WorkflowTemplate) GetName

func (x *WorkflowTemplate) GetName() string

func (*WorkflowTemplate) GetUpdatedAt

func (x *WorkflowTemplate) GetUpdatedAt() *timestamppb.Timestamp

func (*WorkflowTemplate) ProtoMessage

func (*WorkflowTemplate) ProtoMessage()

func (*WorkflowTemplate) ProtoReflect added in v0.2.0

func (x *WorkflowTemplate) ProtoReflect() protoreflect.Message

func (*WorkflowTemplate) Reset

func (x *WorkflowTemplate) Reset()

func (*WorkflowTemplate) String

func (x *WorkflowTemplate) String() string

Jump to

Keyboard shortcuts

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