file

package
v0.0.0-...-26336ce Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileByBase64

func AddFileByBase64(b64s []string) ([]string, *string)

func CheckMatchBase64Image

func CheckMatchBase64Image(originB64 string) bool

func Delete

func Delete(where map[string]interface{}) error

func GetHashIDsByLinkFiles

func GetHashIDsByLinkFiles(lfs []LinkFile) []string

func GetHashIdsAndReferenceByBase64LinkFiles

func GetHashIdsAndReferenceByBase64LinkFiles(lfs []LinkFile) ([]string, *string)

func ReplaceProtocolEmpty

func ReplaceProtocolEmpty(path string) string

Types

type Base64File

type Base64File struct {
	ContentType string
	Extension   string
	Encode      string
}

func ConvertBase64ToBase64File

func ConvertBase64ToBase64File(originB64 string) *Base64File

func (*Base64File) Base64FileConvertToFile

func (b64File *Base64File) Base64FileConvertToFile(filePath string, fileFullName string) *os.File

type File

type File struct {
	ID          uint `json:"-"`
	HashID      string
	Reference   *string `json:"-"`
	System      string  `json:"-"`
	Type        string
	Path        string `json:"-"`
	Name        string `json:"-"`
	ThirdPatyID string `json:"-"`
}

func (*File) Add

func (f *File) Add() (File, error)

func (*File) GetBytes

func (f *File) GetBytes() ([]byte, error)
func (f *File) GetLocalLink() string
func (f *File) GetOpenLink() string

type Files

type Files []File

func BatchUpdates

func BatchUpdates(where map[string]interface{}, updates map[string]interface{}) (Files, error)

func Get

func Get(where map[string]interface{}) (Files, error)

type LinkFile

type LinkFile struct {
	HashID string `json:"hash_id"`
	Type   string `json:"type"`
	Value  string `json:"value"`
}

func GetLinkFilesByReference

func GetLinkFilesByReference(reference *string) []LinkFile

Jump to

Keyboard shortcuts

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