thumq

package module
v0.0.0-...-b50f9b8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-2-Clause Imports: 4 Imported by: 0

README

A simple microservice for creating image thumbnails.

Dependencies

  • Go
  • Unix sockets

Client requirements

  • Unix sockets
  • Protocol Buffers support

Interfacing how-to

  1. Compile the Protocol Buffers in thumq.proto for your language of choice.

  2. Connect to the unix socket.

  3. Send a two-part message: a Request (see thumq.proto) and an image. Each message part is prefixed with a 32-bit little-endian size field.

  4. Receive a two-part message. The first part is a Response (see thumq.proto) and the second is a scaled/cropped/stripped JPEG image (or empty on error).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Request_Crop_name = map[int32]string{
		0: "NO_CROP",
		1: "TOP_SQUARE",
	}
	Request_Crop_value = map[string]int32{
		"NO_CROP":    0,
		"TOP_SQUARE": 1,
	}
)

Enum value maps for Request_Crop.

View Source
var File_thumq_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Request

type Request struct {
	Scale uint32       `protobuf:"varint,1,opt,name=scale,proto3" json:"scale,omitempty"`
	Crop  Request_Crop `protobuf:"varint,2,opt,name=crop,proto3,enum=thumq.Request_Crop" json:"crop,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetCrop

func (x *Request) GetCrop() Request_Crop

func (*Request) GetScale

func (x *Request) GetScale() uint32

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Request_Crop

type Request_Crop int32
const (
	Request_NO_CROP    Request_Crop = 0
	Request_TOP_SQUARE Request_Crop = 1
)

func (Request_Crop) Descriptor

func (Request_Crop) Enum

func (x Request_Crop) Enum() *Request_Crop

func (Request_Crop) EnumDescriptor deprecated

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

Deprecated: Use Request_Crop.Descriptor instead.

func (Request_Crop) Number

func (Request_Crop) String

func (x Request_Crop) String() string

func (Request_Crop) Type

type Response

type Response struct {
	SourceType string `protobuf:"bytes,1,opt,name=source_type,json=sourceType,proto3" json:"source_type,omitempty"`
	NailWidth  uint32 `protobuf:"varint,2,opt,name=nail_width,json=nailWidth,proto3" json:"nail_width,omitempty"`
	NailHeight uint32 `protobuf:"varint,3,opt,name=nail_height,json=nailHeight,proto3" json:"nail_height,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetNailHeight

func (x *Response) GetNailHeight() uint32

func (*Response) GetNailWidth

func (x *Response) GetNailWidth() uint32

func (*Response) GetSourceType

func (x *Response) GetSourceType() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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