db

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DB_Init_FullMethodName    = "/db.DB/Init"
	DB_Migrate_FullMethodName = "/db.DB/Migrate"
)

Variables

View Source
var DB_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "db.DB",
	HandlerType: (*DBServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Init",
			Handler:    _DB_Init_Handler,
		},
		{
			MethodName: "Migrate",
			Handler:    _DB_Migrate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "db/service.proto",
}

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

View Source
var File_db_service_proto protoreflect.FileDescriptor

Functions

func RegisterDBServer

func RegisterDBServer(s grpc.ServiceRegistrar, srv DBServer)

Types

type DBClient

type DBClient interface {
	Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*InitResponse, error)
	Migrate(ctx context.Context, in *MigrateRequest, opts ...grpc.CallOption) (*MigrateResponse, error)
}

DBClient is the client API for DB 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 NewDBClient

func NewDBClient(cc grpc.ClientConnInterface) DBClient

type DBServer

type DBServer interface {
	Init(context.Context, *InitRequest) (*InitResponse, error)
	Migrate(context.Context, *MigrateRequest) (*MigrateResponse, error)
	// contains filtered or unexported methods
}

DBServer is the server API for DB service. All implementations must embed UnimplementedDBServer for forward compatibility

type InitRequest added in v0.1.5

type InitRequest struct {
	Engine   string  `protobuf:"bytes,1,opt,name=engine,proto3" json:"engine,omitempty"`
	Host     string  `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	Port     uint32  `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	Database string  `protobuf:"bytes,4,opt,name=database,proto3" json:"database,omitempty"`
	User     string  `protobuf:"bytes,5,opt,name=user,proto3" json:"user,omitempty"`
	Password string  `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"`
	Ssl      *string `protobuf:"bytes,7,opt,name=ssl,proto3,oneof" json:"ssl,omitempty"` // "disable", "require", "verify-ca", "verify-full"
	// contains filtered or unexported fields
}

func (*InitRequest) Descriptor deprecated added in v0.1.5

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

Deprecated: Use InitRequest.ProtoReflect.Descriptor instead.

func (*InitRequest) GetDatabase added in v0.1.6

func (x *InitRequest) GetDatabase() string

func (*InitRequest) GetEngine added in v0.1.6

func (x *InitRequest) GetEngine() string

func (*InitRequest) GetHost added in v0.1.6

func (x *InitRequest) GetHost() string

func (*InitRequest) GetPassword added in v0.1.6

func (x *InitRequest) GetPassword() string

func (*InitRequest) GetPort added in v0.1.6

func (x *InitRequest) GetPort() uint32

func (*InitRequest) GetSsl added in v0.1.6

func (x *InitRequest) GetSsl() string

func (*InitRequest) GetUser added in v0.1.6

func (x *InitRequest) GetUser() string

func (*InitRequest) ProtoMessage added in v0.1.5

func (*InitRequest) ProtoMessage()

func (*InitRequest) ProtoReflect added in v0.1.5

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

func (*InitRequest) Reset added in v0.1.5

func (x *InitRequest) Reset()

func (*InitRequest) String added in v0.1.5

func (x *InitRequest) String() string

type InitResponse

type InitResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*InitResponse) Descriptor deprecated

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

Deprecated: Use InitResponse.ProtoReflect.Descriptor instead.

func (*InitResponse) GetSuccess

func (x *InitResponse) GetSuccess() bool

func (*InitResponse) ProtoMessage

func (*InitResponse) ProtoMessage()

func (*InitResponse) ProtoReflect

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

func (*InitResponse) Reset

func (x *InitResponse) Reset()

func (*InitResponse) String

func (x *InitResponse) String() string

type MigrateRequest

type MigrateRequest struct {
	Dsn        *InitRequest `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"`
	Migrations []string     `protobuf:"bytes,2,rep,name=migrations,proto3" json:"migrations,omitempty"`
	All        *bool        `protobuf:"varint,3,opt,name=all,proto3,oneof" json:"all,omitempty"`
	Hardfail   bool         `protobuf:"varint,4,opt,name=hardfail,proto3" json:"hardfail,omitempty"` // if true, fail on any error
	// contains filtered or unexported fields
}

func (*MigrateRequest) Descriptor deprecated

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

Deprecated: Use MigrateRequest.ProtoReflect.Descriptor instead.

func (*MigrateRequest) GetAll

func (x *MigrateRequest) GetAll() bool

func (*MigrateRequest) GetDsn added in v0.1.7

func (x *MigrateRequest) GetDsn() *InitRequest

func (*MigrateRequest) GetHardfail

func (x *MigrateRequest) GetHardfail() bool

func (*MigrateRequest) GetMigrations

func (x *MigrateRequest) GetMigrations() []string

func (*MigrateRequest) ProtoMessage

func (*MigrateRequest) ProtoMessage()

func (*MigrateRequest) ProtoReflect

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

func (*MigrateRequest) Reset

func (x *MigrateRequest) Reset()

func (*MigrateRequest) String

func (x *MigrateRequest) String() string

type MigrateResponse

type MigrateResponse struct {
	Success bool              `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Errors  []*MigrationError `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

func (*MigrateResponse) Descriptor deprecated

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

Deprecated: Use MigrateResponse.ProtoReflect.Descriptor instead.

func (*MigrateResponse) GetErrors added in v0.1.8

func (x *MigrateResponse) GetErrors() []*MigrationError

func (*MigrateResponse) GetSuccess

func (x *MigrateResponse) GetSuccess() bool

func (*MigrateResponse) ProtoMessage

func (*MigrateResponse) ProtoMessage()

func (*MigrateResponse) ProtoReflect

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

func (*MigrateResponse) Reset

func (x *MigrateResponse) Reset()

func (*MigrateResponse) String

func (x *MigrateResponse) String() string

type MigrationError added in v0.1.8

type MigrationError struct {
	MigrationPath string `protobuf:"bytes,1,opt,name=migration_path,json=migrationPath,proto3" json:"migration_path,omitempty"`
	Message       string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*MigrationError) Descriptor deprecated added in v0.1.8

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

Deprecated: Use MigrationError.ProtoReflect.Descriptor instead.

func (*MigrationError) GetMessage added in v0.1.8

func (x *MigrationError) GetMessage() string

func (*MigrationError) GetMigrationPath added in v0.1.8

func (x *MigrationError) GetMigrationPath() string

func (*MigrationError) ProtoMessage added in v0.1.8

func (*MigrationError) ProtoMessage()

func (*MigrationError) ProtoReflect added in v0.1.8

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

func (*MigrationError) Reset added in v0.1.8

func (x *MigrationError) Reset()

func (*MigrationError) String added in v0.1.8

func (x *MigrationError) String() string

type UnimplementedDBServer

type UnimplementedDBServer struct {
}

UnimplementedDBServer must be embedded to have forward compatible implementations.

func (UnimplementedDBServer) Init

func (UnimplementedDBServer) Migrate

type UnsafeDBServer

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

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

Jump to

Keyboard shortcuts

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