redirection

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const I18nRedirectionKey i18n.ModuleKey = "I18nRedirectionKey"
View Source
const (
	UploadFileEvent = "redirection_UploadFileEvent"
)

Variables

View Source
var Messages_en_US = &Messages{
	RepeatedSourceErrorTemplate:    "Row {Rows}: Source Is Duplicated.",
	SourceInvalidFormatTemplate:    "Source Invalid Format",
	TargetInvalidFormatTemplate:    "Target Invalid Format",
	TargetUnreachableErrorTemplate: "Row {Rows}: Target Is Unreachable.",
	TargetObjectNotExistedTemplate: "Row {Rows}: Target Object Not Existed",
	NormalErrorTemplate:            "Row {Rows}:{Message}",
	RedirectErrorTemplate:          "Row {Rows}: Redirection Failed.",
	FileUploadFailed:               "File Upload Failed",
	ErrorTips:                      "ErrorTips",
}
View Source
var Messages_ja_JP = &Messages{
	RepeatedSourceErrorTemplate:    "{Rows}行目: Source が重複しています。",
	SourceInvalidFormatTemplate:    "Source のフォーマットが無効です。",
	TargetInvalidFormatTemplate:    "Target のフォーマットが無効です。",
	TargetUnreachableErrorTemplate: "{Rows}行目: Target に到達できません。",
	TargetObjectNotExistedTemplate: "ターゲットオブジェクトが存在しません。",
	NormalErrorTemplate:            "{Rows}行目: {Message}",
	RedirectErrorTemplate:          "{Rows}行目: リダイレクトに失敗しました。",
	FileUploadFailed:               "ファイルのアップロードに失敗しました。",
	ErrorTips:                      "エラーのヒント",
}
View Source
var Messages_zh_CN = &Messages{
	RepeatedSourceErrorTemplate:    "第{Rows}行:源数据重复。",
	SourceInvalidFormatTemplate:    "源数据格式无效。",
	TargetInvalidFormatTemplate:    "目标格式无效。",
	TargetUnreachableErrorTemplate: "第{Rows}行:目标无法访问。",
	TargetObjectNotExistedTemplate: "第{Rows}行:目标对象不存在。",
	NormalErrorTemplate:            "第{Rows}行:{Message}",
	RedirectErrorTemplate:          "第{Rows}行:重定向失败。",
	FileUploadFailed:               "文件上传失败。",
	ErrorTips:                      "错误提示",
}

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB) error

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func New

func New(s3Client *s3.Client, db *gorm.DB, publisher *publish.Builder) *Builder

func (*Builder) AutoMigrate

func (b *Builder) AutoMigrate() *Builder

func (*Builder) Delete

func (b *Builder) Delete(ctx context.Context, path string) error

func (*Builder) Get

func (b *Builder) Get(ctx context.Context, path string) (*os.File, error)

func (*Builder) GetEndpoint

func (b *Builder) GetEndpoint(ctx context.Context) string

func (*Builder) GetStream

func (b *Builder) GetStream(ctx context.Context, path string) (io.ReadCloser, error)

func (*Builder) GetURL

func (b *Builder) GetURL(ctx context.Context, path string) (string, error)

func (*Builder) Install

func (b *Builder) Install(pb *presets.Builder) (err error)

func (*Builder) List

func (b *Builder) List(ctx context.Context, path string) ([]*oss.Object, error)

func (*Builder) Put

func (b *Builder) Put(ctx context.Context, path string, reader io.Reader) (obj *oss.Object, err error)

type Messages

type Messages struct {
	RepeatedSourceErrorTemplate    string
	SourceInvalidFormatTemplate    string
	TargetInvalidFormatTemplate    string
	TargetUnreachableErrorTemplate string
	TargetObjectNotExistedTemplate string
	NormalErrorTemplate            string
	RedirectErrorTemplate          string
	FileUploadFailed               string
	ErrorTips                      string
}

func (*Messages) InvalidFormat

func (msgr *Messages) InvalidFormat(vs map[string]string) string

func (*Messages) RedirectError

func (msgr *Messages) RedirectError(vs []string) string

func (*Messages) RepeatedSource

func (msgr *Messages) RepeatedSource(vs map[string][]string) string

func (*Messages) SourceInvalidFormat

func (msgr *Messages) SourceInvalidFormat(name string) string

func (*Messages) TargetInvalidFormat

func (msgr *Messages) TargetInvalidFormat(name string) string

func (*Messages) TargetObjectNotExisted

func (msgr *Messages) TargetObjectNotExisted(vs []string) string

func (*Messages) TargetUnreachableError

func (msgr *Messages) TargetUnreachableError(vs map[string][]string) string

type Redirection

type Redirection struct {
	gorm.Model
	Source string `csv:"source"`
	Target string `csv:"target"`
}

func (*Redirection) TableName

func (b *Redirection) TableName() string

Jump to

Keyboard shortcuts

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