_go

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImageType_name = map[int32]string{
		0: "WEBP",
		1: "PNG",
		2: "JPEG",
		4: "GIF",
		5: "AVIF",
	}
	ImageType_value = map[string]int32{
		"WEBP": 0,
		"PNG":  1,
		"JPEG": 2,
		"GIF":  4,
		"AVIF": 5,
	}
)

Enum value maps for ImageType.

View Source
var (
	ObjectFit_name = map[int32]string{
		0: "CONTAIN",
		1: "COVER",
		2: "FILL",
		3: "INSIDE",
		4: "OUTSIDE",
	}
	ObjectFit_value = map[string]int32{
		"CONTAIN": 0,
		"COVER":   1,
		"FILL":    2,
		"INSIDE":  3,
		"OUTSIDE": 4,
	}
)

Enum value maps for ObjectFit.

View Source
var FluxImage_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "flux.FluxImage",
	HandlerType: (*FluxImageServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Resize",
			Handler:       _FluxImage_Resize_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "flux.proto",
}

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

Functions

func RegisterFluxImageServer

func RegisterFluxImageServer(s grpc.ServiceRegistrar, srv FluxImageServer)

Types

type FluxImageClient

type FluxImageClient interface {
	Resize(ctx context.Context, opts ...grpc.CallOption) (FluxImage_ResizeClient, error)
}

FluxImageClient is the client API for FluxImage 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 NewFluxImageClient

func NewFluxImageClient(cc grpc.ClientConnInterface) FluxImageClient

type FluxImageServer

type FluxImageServer interface {
	Resize(FluxImage_ResizeServer) error
	// contains filtered or unexported methods
}

FluxImageServer is the server API for FluxImage service. All implementations must embed UnimplementedFluxImageServer for forward compatibility

type FluxImage_ResizeClient added in v1.0.4

type FluxImage_ResizeClient interface {
	Send(*ResizeRequest) error
	CloseAndRecv() (*ResizeResponse, error)
	grpc.ClientStream
}

type FluxImage_ResizeServer added in v1.0.4

type FluxImage_ResizeServer interface {
	SendAndClose(*ResizeResponse) error
	Recv() (*ResizeRequest, error)
	grpc.ServerStream
}

type ImageType

type ImageType int32
const (
	ImageType_WEBP ImageType = 0
	ImageType_PNG  ImageType = 1
	ImageType_JPEG ImageType = 2
	ImageType_GIF  ImageType = 4
	ImageType_AVIF ImageType = 5
)

func (ImageType) Descriptor

func (ImageType) Descriptor() protoreflect.EnumDescriptor

func (ImageType) Enum

func (x ImageType) Enum() *ImageType

func (ImageType) EnumDescriptor deprecated

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

Deprecated: Use ImageType.Descriptor instead.

func (ImageType) Number

func (x ImageType) Number() protoreflect.EnumNumber

func (ImageType) String

func (x ImageType) String() string

func (ImageType) Type

type ObjectFit

type ObjectFit int32

Reference: https://sharp.pixelplumbing.com/api-resize#resize

const (
	ObjectFit_CONTAIN ObjectFit = 0
	ObjectFit_COVER   ObjectFit = 1
	ObjectFit_FILL    ObjectFit = 2
	ObjectFit_INSIDE  ObjectFit = 3
	ObjectFit_OUTSIDE ObjectFit = 4
)

func (ObjectFit) Descriptor

func (ObjectFit) Descriptor() protoreflect.EnumDescriptor

func (ObjectFit) Enum

func (x ObjectFit) Enum() *ObjectFit

func (ObjectFit) EnumDescriptor deprecated

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

Deprecated: Use ObjectFit.Descriptor instead.

func (ObjectFit) Number

func (x ObjectFit) Number() protoreflect.EnumNumber

func (ObjectFit) String

func (x ObjectFit) String() string

func (ObjectFit) Type

type ResizeOptions

type ResizeOptions struct {
	ImageType       ImageType  `protobuf:"varint,1,opt,name=image_type,json=imageType,proto3,enum=flux.ImageType" json:"image_type,omitempty"`
	Width           int32      `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"`
	Height          int32      `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
	ObjectFit       *ObjectFit `protobuf:"varint,4,opt,name=object_fit,json=objectFit,proto3,enum=flux.ObjectFit,oneof" json:"object_fit,omitempty"`
	Quality         *int32     `protobuf:"varint,5,opt,name=quality,proto3,oneof" json:"quality,omitempty"`
	BackgroundColor *string    `protobuf:"bytes,6,opt,name=background_color,json=backgroundColor,proto3,oneof" json:"background_color,omitempty"` // hex color (default #000000)
	// contains filtered or unexported fields
}

func (*ResizeOptions) Descriptor deprecated

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

Deprecated: Use ResizeOptions.ProtoReflect.Descriptor instead.

func (*ResizeOptions) GetBackgroundColor

func (x *ResizeOptions) GetBackgroundColor() string

func (*ResizeOptions) GetHeight

func (x *ResizeOptions) GetHeight() int32

func (*ResizeOptions) GetImageType

func (x *ResizeOptions) GetImageType() ImageType

func (*ResizeOptions) GetObjectFit

func (x *ResizeOptions) GetObjectFit() ObjectFit

func (*ResizeOptions) GetQuality

func (x *ResizeOptions) GetQuality() int32

func (*ResizeOptions) GetWidth

func (x *ResizeOptions) GetWidth() int32

func (*ResizeOptions) ProtoMessage

func (*ResizeOptions) ProtoMessage()

func (*ResizeOptions) ProtoReflect

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

func (*ResizeOptions) Reset

func (x *ResizeOptions) Reset()

func (*ResizeOptions) String

func (x *ResizeOptions) String() string

type ResizeRequest

type ResizeRequest struct {
	ImageData []byte         `protobuf:"bytes,1,opt,name=image_data,json=imageData,proto3" json:"image_data,omitempty"`
	Options   *ResizeOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*ResizeRequest) Descriptor deprecated

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

Deprecated: Use ResizeRequest.ProtoReflect.Descriptor instead.

func (*ResizeRequest) GetImageData

func (x *ResizeRequest) GetImageData() []byte

func (*ResizeRequest) GetOptions

func (x *ResizeRequest) GetOptions() *ResizeOptions

func (*ResizeRequest) ProtoMessage

func (*ResizeRequest) ProtoMessage()

func (*ResizeRequest) ProtoReflect

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

func (*ResizeRequest) Reset

func (x *ResizeRequest) Reset()

func (*ResizeRequest) String

func (x *ResizeRequest) String() string

type ResizeResponse

type ResizeResponse struct {
	ImageData []byte `protobuf:"bytes,1,opt,name=image_data,json=imageData,proto3" json:"image_data,omitempty"`
	// contains filtered or unexported fields
}

func (*ResizeResponse) Descriptor deprecated

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

Deprecated: Use ResizeResponse.ProtoReflect.Descriptor instead.

func (*ResizeResponse) GetImageData

func (x *ResizeResponse) GetImageData() []byte

func (*ResizeResponse) ProtoMessage

func (*ResizeResponse) ProtoMessage()

func (*ResizeResponse) ProtoReflect

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

func (*ResizeResponse) Reset

func (x *ResizeResponse) Reset()

func (*ResizeResponse) String

func (x *ResizeResponse) String() string

type UnimplementedFluxImageServer

type UnimplementedFluxImageServer struct {
}

UnimplementedFluxImageServer must be embedded to have forward compatible implementations.

func (UnimplementedFluxImageServer) Resize

type UnsafeFluxImageServer

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

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

Jump to

Keyboard shortcuts

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