pb

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthOptim = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOptim   = fmt.Errorf("proto: integer overflow")
)
View Source
var Type_name = map[int32]string{
	0:  "UNKNOWN",
	1:  "GZIP",
	2:  "BR",
	3:  "SNAPPY",
	4:  "LZ4",
	5:  "ZSTD",
	11: "JPEG",
	12: "PNG",
	13: "WEBP",
	14: "AVIF",
}
View Source
var Type_value = map[string]int32{
	"UNKNOWN": 0,
	"GZIP":    1,
	"BR":      2,
	"SNAPPY":  3,
	"LZ4":     4,
	"ZSTD":    5,
	"JPEG":    11,
	"PNG":     12,
	"WEBP":    13,
	"AVIF":    14,
}

Functions

func RegisterOptimServer

func RegisterOptimServer(s *grpc.Server, srv OptimServer)

Types

type OptimClient

type OptimClient interface {
	DoOptim(ctx context.Context, in *OptimRequest, opts ...grpc.CallOption) (*OptimReply, error)
}

OptimClient is the client API for Optim service.

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

func NewOptimClient

func NewOptimClient(cc *grpc.ClientConn) OptimClient

type OptimReply

type OptimReply struct {
	Output               Type     `protobuf:"varint,1,opt,name=output,proto3,enum=pb.Type" json:"output,omitempty"`
	Data                 []byte   `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Width                uint32   `protobuf:"varint,8,opt,name=width,proto3" json:"width,omitempty"`
	Height               uint32   `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The response message for optim

func (*OptimReply) Descriptor

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

func (*OptimReply) GetData

func (m *OptimReply) GetData() []byte

func (*OptimReply) GetHeight

func (m *OptimReply) GetHeight() uint32

func (*OptimReply) GetOutput

func (m *OptimReply) GetOutput() Type

func (*OptimReply) GetWidth

func (m *OptimReply) GetWidth() uint32

func (*OptimReply) Marshal added in v1.0.2

func (m *OptimReply) Marshal() (dAtA []byte, err error)

func (*OptimReply) MarshalTo added in v1.0.2

func (m *OptimReply) MarshalTo(dAtA []byte) (int, error)

func (*OptimReply) MarshalToSizedBuffer added in v1.0.2

func (m *OptimReply) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OptimReply) ProtoMessage

func (*OptimReply) ProtoMessage()

func (*OptimReply) Reset

func (m *OptimReply) Reset()

func (*OptimReply) Size added in v1.0.2

func (m *OptimReply) Size() (n int)

func (*OptimReply) String

func (m *OptimReply) String() string

func (*OptimReply) Unmarshal added in v1.0.2

func (m *OptimReply) Unmarshal(dAtA []byte) error

func (*OptimReply) XXX_DiscardUnknown

func (m *OptimReply) XXX_DiscardUnknown()

func (*OptimReply) XXX_Marshal

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

func (*OptimReply) XXX_Merge

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

func (*OptimReply) XXX_Size

func (m *OptimReply) XXX_Size() int

func (*OptimReply) XXX_Unmarshal

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

type OptimRequest

type OptimRequest struct {
	// 数据类型
	Source Type   `protobuf:"varint,1,opt,name=source,proto3,enum=pb.Type" json:"source,omitempty"`
	Data   []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// 输出类型
	Output  Type   `protobuf:"varint,6,opt,name=output,proto3,enum=pb.Type" json:"output,omitempty"`
	Quality uint32 `protobuf:"varint,7,opt,name=quality,proto3" json:"quality,omitempty"`
	Width   uint32 `protobuf:"varint,8,opt,name=width,proto3" json:"width,omitempty"`
	Height  uint32 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"`
	// 裁剪类型
	Crop                 uint32   `protobuf:"varint,10,opt,name=crop,proto3" json:"crop,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The request message for optim

func (*OptimRequest) Descriptor

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

func (*OptimRequest) GetCrop

func (m *OptimRequest) GetCrop() uint32

func (*OptimRequest) GetData

func (m *OptimRequest) GetData() []byte

func (*OptimRequest) GetHeight

func (m *OptimRequest) GetHeight() uint32

func (*OptimRequest) GetOutput

func (m *OptimRequest) GetOutput() Type

func (*OptimRequest) GetQuality

func (m *OptimRequest) GetQuality() uint32

func (*OptimRequest) GetSource

func (m *OptimRequest) GetSource() Type

func (*OptimRequest) GetWidth

func (m *OptimRequest) GetWidth() uint32

func (*OptimRequest) Marshal added in v1.0.2

func (m *OptimRequest) Marshal() (dAtA []byte, err error)

func (*OptimRequest) MarshalTo added in v1.0.2

func (m *OptimRequest) MarshalTo(dAtA []byte) (int, error)

func (*OptimRequest) MarshalToSizedBuffer added in v1.0.2

func (m *OptimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OptimRequest) ProtoMessage

func (*OptimRequest) ProtoMessage()

func (*OptimRequest) Reset

func (m *OptimRequest) Reset()

func (*OptimRequest) Size added in v1.0.2

func (m *OptimRequest) Size() (n int)

func (*OptimRequest) String

func (m *OptimRequest) String() string

func (*OptimRequest) Unmarshal added in v1.0.2

func (m *OptimRequest) Unmarshal(dAtA []byte) error

func (*OptimRequest) XXX_DiscardUnknown

func (m *OptimRequest) XXX_DiscardUnknown()

func (*OptimRequest) XXX_Marshal

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

func (*OptimRequest) XXX_Merge

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

func (*OptimRequest) XXX_Size

func (m *OptimRequest) XXX_Size() int

func (*OptimRequest) XXX_Unmarshal

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

type OptimServer

type OptimServer interface {
	DoOptim(context.Context, *OptimRequest) (*OptimReply, error)
}

OptimServer is the server API for Optim service.

type Type

type Type int32
const (
	Type_UNKNOWN Type = 0
	Type_GZIP    Type = 1
	Type_BR      Type = 2
	// snappy
	Type_SNAPPY Type = 3
	// lz4
	Type_LZ4 Type = 4
	// zstd
	Type_ZSTD Type = 5
	Type_JPEG Type = 11
	Type_PNG  Type = 12
	Type_WEBP Type = 13
	// AVIF
	Type_AVIF Type = 14
)

func (Type) EnumDescriptor

func (Type) EnumDescriptor() ([]byte, []int)

func (Type) String

func (x Type) String() string

type UnimplementedOptimServer

type UnimplementedOptimServer struct {
}

UnimplementedOptimServer can be embedded to have forward compatible implementations.

func (*UnimplementedOptimServer) DoOptim

Jump to

Keyboard shortcuts

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