Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

6.7 KB
Raw Blame
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             (unknown)
// source: v1/changelog_service.proto

package v1

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	ChangelogService_ListChangelogs_FullMethodName = "/bytebase.v1.ChangelogService/ListChangelogs"
	ChangelogService_GetChangelog_FullMethodName   = "/bytebase.v1.ChangelogService/GetChangelog"
)

// ChangelogServiceClient is the client API for ChangelogService 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.
//
// ChangelogService manages database migration history.
type ChangelogServiceClient interface {
	// Lists migration history for a database.
	// Permissions required: bb.changelogs.list
	ListChangelogs(ctx context.Context, in *ListChangelogsRequest, opts ...grpc.CallOption) (*ListChangelogsResponse, error)
	// Retrieves a specific changelog entry.
	// Permissions required: bb.changelogs.get
	GetChangelog(ctx context.Context, in *GetChangelogRequest, opts ...grpc.CallOption) (*Changelog, error)
}

type changelogServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewChangelogServiceClient(cc grpc.ClientConnInterface) ChangelogServiceClient {
	return &changelogServiceClient{cc}
}

func (c *changelogServiceClient) ListChangelogs(ctx context.Context, in *ListChangelogsRequest, opts ...grpc.CallOption) (*ListChangelogsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListChangelogsResponse)
	err := c.cc.Invoke(ctx, ChangelogService_ListChangelogs_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *changelogServiceClient) GetChangelog(ctx context.Context, in *GetChangelogRequest, opts ...grpc.CallOption) (*Changelog, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Changelog)
	err := c.cc.Invoke(ctx, ChangelogService_GetChangelog_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ChangelogServiceServer is the server API for ChangelogService service.
// All implementations must embed UnimplementedChangelogServiceServer
// for forward compatibility.
//
// ChangelogService manages database migration history.
type ChangelogServiceServer interface {
	// Lists migration history for a database.
	// Permissions required: bb.changelogs.list
	ListChangelogs(context.Context, *ListChangelogsRequest) (*ListChangelogsResponse, error)
	// Retrieves a specific changelog entry.
	// Permissions required: bb.changelogs.get
	GetChangelog(context.Context, *GetChangelogRequest) (*Changelog, error)
	mustEmbedUnimplementedChangelogServiceServer()
}

// UnimplementedChangelogServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedChangelogServiceServer struct{}

func (UnimplementedChangelogServiceServer) ListChangelogs(context.Context, *ListChangelogsRequest) (*ListChangelogsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListChangelogs not implemented")
}
func (UnimplementedChangelogServiceServer) GetChangelog(context.Context, *GetChangelogRequest) (*Changelog, error) {
	return nil, status.Error(codes.Unimplemented, "method GetChangelog not implemented")
}
func (UnimplementedChangelogServiceServer) mustEmbedUnimplementedChangelogServiceServer() {}
func (UnimplementedChangelogServiceServer) testEmbeddedByValue()                          {}

// UnsafeChangelogServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ChangelogServiceServer will
// result in compilation errors.
type UnsafeChangelogServiceServer interface {
	mustEmbedUnimplementedChangelogServiceServer()
}

func RegisterChangelogServiceServer(s grpc.ServiceRegistrar, srv ChangelogServiceServer) {
	// If the following call panics, it indicates UnimplementedChangelogServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&ChangelogService_ServiceDesc, srv)
}

func _ChangelogService_ListChangelogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListChangelogsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChangelogServiceServer).ListChangelogs(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ChangelogService_ListChangelogs_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChangelogServiceServer).ListChangelogs(ctx, req.(*ListChangelogsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ChangelogService_GetChangelog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetChangelogRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChangelogServiceServer).GetChangelog(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ChangelogService_GetChangelog_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChangelogServiceServer).GetChangelog(ctx, req.(*GetChangelogRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ChangelogService_ServiceDesc is the grpc.ServiceDesc for ChangelogService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ChangelogService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "bytebase.v1.ChangelogService",
	HandlerType: (*ChangelogServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListChangelogs",
			Handler:    _ChangelogService_ListChangelogs_Handler,
		},
		{
			MethodName: "GetChangelog",
			Handler:    _ChangelogService_GetChangelog_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1/changelog_service.proto",
}