contentupload

package
v0.0.0-...-3ce7580 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Image_ScaleDirection_name = map[int32]string{
		0: "WIDTH",
		1: "HEIGHT",
	}
	Image_ScaleDirection_value = map[string]int32{
		"WIDTH":  0,
		"HEIGHT": 1,
	}
)

Enum value maps for Image_ScaleDirection.

View Source
var File_contentupload_attachment_proto protoreflect.FileDescriptor
View Source
var File_contentupload_contentupload_proto protoreflect.FileDescriptor
View Source
var File_contentupload_file_proto protoreflect.FileDescriptor
View Source
var File_contentupload_image_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Id           string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	RefId        string   `protobuf:"bytes,2,opt,name=ref_id,json=refId,proto3" json:"ref_id,omitempty"`
	OwnerId      string   `protobuf:"bytes,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
	Path         string   `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` // private path of the resource
	Name         string   `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` // name of the resource
	Url          string   `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"`   // public URL of the resource
	ContentType  string   `protobuf:"bytes,7,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	ContentSize  int64    `protobuf:"varint,8,opt,name=content_size,json=contentSize,proto3" json:"content_size,omitempty"`
	Description  string   `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"`
	Tags         []string `protobuf:"bytes,10,rep,name=tags,proto3" json:"tags,omitempty"` // meta data
	Ordering     int32    `protobuf:"varint,11,opt,name=ordering,proto3" json:"ordering,omitempty"`
	ImageDataUrl string   `protobuf:"bytes,12,opt,name=image_data_url,json=imageDataUrl,proto3" json:"image_data_url,omitempty"` // image (thumbnail) data URL if applicable
	CreatedAt    string   `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	Hash         string   `protobuf:"bytes,14,opt,name=hash,proto3" json:"hash,omitempty"` // hash of the attachment
	// contains filtered or unexported fields
}

Or actual "content" that we uploaded to storage (eg. GCS); here is the meetadata. TODO: make generic in other module

func (*Attachment) Descriptor deprecated

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

Deprecated: Use Attachment.ProtoReflect.Descriptor instead.

func (*Attachment) GetContentSize

func (x *Attachment) GetContentSize() int64

func (*Attachment) GetContentType

func (x *Attachment) GetContentType() string

func (*Attachment) GetCreatedAt

func (x *Attachment) GetCreatedAt() string

func (*Attachment) GetDescription

func (x *Attachment) GetDescription() string

func (*Attachment) GetHash

func (x *Attachment) GetHash() string

func (*Attachment) GetId

func (x *Attachment) GetId() string

func (*Attachment) GetImageDataUrl

func (x *Attachment) GetImageDataUrl() string

func (*Attachment) GetName

func (x *Attachment) GetName() string

func (*Attachment) GetOrdering

func (x *Attachment) GetOrdering() int32

func (*Attachment) GetOwnerId

func (x *Attachment) GetOwnerId() string

func (*Attachment) GetPath

func (x *Attachment) GetPath() string

func (*Attachment) GetRefId

func (x *Attachment) GetRefId() string

func (*Attachment) GetTags

func (x *Attachment) GetTags() []string

func (*Attachment) GetUrl

func (x *Attachment) GetUrl() string

func (*Attachment) ProtoMessage

func (*Attachment) ProtoMessage()

func (*Attachment) ProtoReflect

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

func (*Attachment) Reset

func (x *Attachment) Reset()

func (*Attachment) String

func (x *Attachment) String() string

type Content

type Content struct {
	Id          string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Type        string                 `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Length      int64                  `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"`
	Encoding    string                 `protobuf:"bytes,4,opt,name=encoding,proto3" json:"encoding,omitempty"`
	Title       string                 `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"`
	Description string                 `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
	Language    string                 `protobuf:"bytes,7,opt,name=language,proto3" json:"language,omitempty"`
	Tags        string                 `protobuf:"bytes,8,opt,name=tags,proto3" json:"tags,omitempty"`
	Width       int32                  `protobuf:"varint,9,opt,name=width,proto3" json:"width,omitempty"`                             // if applicable
	Height      int32                  `protobuf:"varint,10,opt,name=height,proto3" json:"height,omitempty"`                          // if applicable
	UploadDate  *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=upload_date,json=uploadDate,proto3" json:"upload_date,omitempty"` // for validation
	Thumbnails  *Thumbnails            `protobuf:"bytes,12,opt,name=thumbnails,proto3" json:"thumbnails,omitempty"`                   // if applicable
	// contains filtered or unexported fields
}

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers Basically, it's more a ContentMetadata

func (*Content) Descriptor deprecated

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

Deprecated: Use Content.ProtoReflect.Descriptor instead.

func (*Content) GetDescription

func (x *Content) GetDescription() string

func (*Content) GetEncoding

func (x *Content) GetEncoding() string

func (*Content) GetHeight

func (x *Content) GetHeight() int32

func (*Content) GetId

func (x *Content) GetId() string

func (*Content) GetLanguage

func (x *Content) GetLanguage() string

func (*Content) GetLength

func (x *Content) GetLength() int64

func (*Content) GetTags

func (x *Content) GetTags() string

func (*Content) GetThumbnails

func (x *Content) GetThumbnails() *Thumbnails

func (*Content) GetTitle

func (x *Content) GetTitle() string

func (*Content) GetType

func (x *Content) GetType() string

func (*Content) GetUploadDate

func (x *Content) GetUploadDate() *timestamppb.Timestamp

func (*Content) GetWidth

func (x *Content) GetWidth() int32

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) ProtoReflect

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

func (*Content) Reset

func (x *Content) Reset()

func (*Content) String

func (x *Content) String() string

type File

type File struct {
	Id          string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Url         string   `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	Description string   `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Tags        []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

File upload config

func (*File) Descriptor deprecated

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

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetDescription

func (x *File) GetDescription() string

func (*File) GetId

func (x *File) GetId() string

func (*File) GetTags

func (x *File) GetTags() []string

func (*File) GetUrl

func (x *File) GetUrl() string

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

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

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type Image

type Image struct {
	Id             string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	ThumbnailUrl   string               `protobuf:"bytes,2,opt,name=thumbnail_url,json=thumbnailUrl,proto3" json:"thumbnail_url,omitempty"` // smaller version of the image
	OffsetX        int32                `protobuf:"varint,3,opt,name=offset_x,json=offsetX,proto3" json:"offset_x,omitempty"`
	OffsetY        int32                `protobuf:"varint,4,opt,name=offset_y,json=offsetY,proto3" json:"offset_y,omitempty"`
	RatioX         int32                `protobuf:"varint,5,opt,name=ratio_x,json=ratioX,proto3" json:"ratio_x,omitempty"` // will only crop if image width is higher
	RatioY         int32                `protobuf:"varint,6,opt,name=ratio_y,json=ratioY,proto3" json:"ratio_y,omitempty"` // will only crop if image height is higher
	DataUrl        string               `protobuf:"bytes,7,opt,name=data_url,json=dataUrl,proto3" json:"data_url,omitempty"`
	Url            string               `protobuf:"bytes,8,opt,name=url,proto3" json:"url,omitempty"`                         // full version of the image (can be different ratio)
	ScalePx        int32                `protobuf:"varint,9,opt,name=scale_px,json=scalePx,proto3" json:"scale_px,omitempty"` // scale in px
	ScaleDirection Image_ScaleDirection ``                                                                                    // either: "width" / "height"
	/* 145-byte string literal not displayed */
	Description string   `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"`
	Tags        []string `protobuf:"bytes,12,rep,name=tags,proto3" json:"tags,omitempty"`
	Rotation    float64  `protobuf:"fixed64,13,opt,name=rotation,proto3" json:"rotation,omitempty"`
	// contains filtered or unexported fields
}

Image represent both image upload config and image display config

func (*Image) Descriptor deprecated

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

Deprecated: Use Image.ProtoReflect.Descriptor instead.

func (*Image) GetDataUrl

func (x *Image) GetDataUrl() string

func (*Image) GetDescription

func (x *Image) GetDescription() string

func (*Image) GetId

func (x *Image) GetId() string

func (*Image) GetOffsetX

func (x *Image) GetOffsetX() int32

func (*Image) GetOffsetY

func (x *Image) GetOffsetY() int32

func (*Image) GetRatioX

func (x *Image) GetRatioX() int32

func (*Image) GetRatioY

func (x *Image) GetRatioY() int32

func (*Image) GetRotation

func (x *Image) GetRotation() float64

func (*Image) GetScaleDirection

func (x *Image) GetScaleDirection() Image_ScaleDirection

func (*Image) GetScalePx

func (x *Image) GetScalePx() int32

func (*Image) GetTags

func (x *Image) GetTags() []string

func (*Image) GetThumbnailUrl

func (x *Image) GetThumbnailUrl() string

func (*Image) GetUrl

func (x *Image) GetUrl() string

func (*Image) ProtoMessage

func (*Image) ProtoMessage()

func (*Image) ProtoReflect

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

func (*Image) Reset

func (x *Image) Reset()

func (*Image) String

func (x *Image) String() string

type Image_ScaleDirection

type Image_ScaleDirection int32
const (
	Image_WIDTH  Image_ScaleDirection = 0
	Image_HEIGHT Image_ScaleDirection = 1
)

func (Image_ScaleDirection) Descriptor

func (Image_ScaleDirection) Enum

func (Image_ScaleDirection) EnumDescriptor deprecated

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

Deprecated: Use Image_ScaleDirection.Descriptor instead.

func (Image_ScaleDirection) Number

func (Image_ScaleDirection) String

func (x Image_ScaleDirection) String() string

func (Image_ScaleDirection) Type

type Thumbnails

type Thumbnails struct {
	RatioOriginal bool `protobuf:"varint,1,opt,name=ratio_original,json=ratioOriginal,proto3" json:"ratio_original,omitempty"`
	Ratio_1X1     bool `protobuf:"varint,2,opt,name=ratio_1x1,json=ratio1x1,proto3" json:"ratio_1x1,omitempty"`
	Ratio_1X2     bool `protobuf:"varint,3,opt,name=ratio_1x2,json=ratio1x2,proto3" json:"ratio_1x2,omitempty"`
	Ratio_1X3     bool `protobuf:"varint,4,opt,name=ratio_1x3,json=ratio1x3,proto3" json:"ratio_1x3,omitempty"`
	Ratio_2X1     bool `protobuf:"varint,5,opt,name=ratio_2x1,json=ratio2x1,proto3" json:"ratio_2x1,omitempty"`
	Ratio_2X3     bool `protobuf:"varint,6,opt,name=ratio_2x3,json=ratio2x3,proto3" json:"ratio_2x3,omitempty"`
	Ratio_3X1     bool `protobuf:"varint,7,opt,name=ratio_3x1,json=ratio3x1,proto3" json:"ratio_3x1,omitempty"`
	Ratio_3X2     bool `protobuf:"varint,8,opt,name=ratio_3x2,json=ratio3x2,proto3" json:"ratio_3x2,omitempty"`
	Ratio_9X16    bool `protobuf:"varint,9,opt,name=ratio_9x16,json=ratio9x16,proto3" json:"ratio_9x16,omitempty"`
	Ratio_16X9    bool `protobuf:"varint,10,opt,name=ratio_16x9,json=ratio16x9,proto3" json:"ratio_16x9,omitempty"`
	// contains filtered or unexported fields
}

Image Thumbnails

func (*Thumbnails) Descriptor deprecated

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

Deprecated: Use Thumbnails.ProtoReflect.Descriptor instead.

func (*Thumbnails) GetRatioOriginal

func (x *Thumbnails) GetRatioOriginal() bool

func (*Thumbnails) GetRatio_16X9

func (x *Thumbnails) GetRatio_16X9() bool

func (*Thumbnails) GetRatio_1X1

func (x *Thumbnails) GetRatio_1X1() bool

func (*Thumbnails) GetRatio_1X2

func (x *Thumbnails) GetRatio_1X2() bool

func (*Thumbnails) GetRatio_1X3

func (x *Thumbnails) GetRatio_1X3() bool

func (*Thumbnails) GetRatio_2X1

func (x *Thumbnails) GetRatio_2X1() bool

func (*Thumbnails) GetRatio_2X3

func (x *Thumbnails) GetRatio_2X3() bool

func (*Thumbnails) GetRatio_3X1

func (x *Thumbnails) GetRatio_3X1() bool

func (*Thumbnails) GetRatio_3X2

func (x *Thumbnails) GetRatio_3X2() bool

func (*Thumbnails) GetRatio_9X16

func (x *Thumbnails) GetRatio_9X16() bool

func (*Thumbnails) ProtoMessage

func (*Thumbnails) ProtoMessage()

func (*Thumbnails) ProtoReflect

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

func (*Thumbnails) Reset

func (x *Thumbnails) Reset()

func (*Thumbnails) String

func (x *Thumbnails) String() string

Jump to

Keyboard shortcuts

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