ali_notifier

package
v0.0.0-...-9bec60d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecureJoin

func SecureJoin(root string, components string) string

Types

type AliDriveConfig

type AliDriveConfig struct {
	RefreshToken string `yaml:"refresh-token"`
	DriveId      string `yaml:"drive-id"`
	RootPath     string `yaml:"root-path"`
	ChunkSize    string `yaml:"chunk-size"`
}

type BackendConfig

type BackendConfig struct {
	JwtSecret    string `yaml:"jwt-secret"`
	Account      string `yaml:"account"`
	PasswordHash string `yaml:"password-hash"`
}

type BiliNotificationRequest

type BiliNotificationRequest struct {
	EventType      string                 `json:"EventType"`
	EventTimestamp string                 `json:"EventTimestamp"`
	EventId        string                 `json:"EventId"`
	EventData      map[string]interface{} `json:"EventData"`
}

type BiliNotificationResponse

type BiliNotificationResponse struct {
	Message string `json:"message"`
}

type Config

type Config struct {
	Version  string                     `yaml:"version"`
	AliDrive AliDriveConfig             `yaml:"ali-drive"`
	Backend  BackendConfig              `yaml:"backend"`
	Servers  map[string]*RegistryConfig `yaml:"servers"`
}

type FsUploadRequest

type FsUploadRequest struct {
	TransactionID uint64

	Group      string
	DriveID    string
	RemotePath string
	LocalPath  string
}

type HttpRecorderNotifier

type HttpRecorderNotifier struct {
	Notifier
	CapturePath string
	StorePath   string
}

func (*HttpRecorderNotifier) ExposeHttp

func (b *HttpRecorderNotifier) ExposeHttp(r *iris.Application)

func (*HttpRecorderNotifier) NotifyBilibiliEvent

func (b *HttpRecorderNotifier) NotifyBilibiliEvent(ctx *context.Context)

func (*HttpRecorderNotifier) NotifyMaybeUploadEvent

func (b *HttpRecorderNotifier) NotifyMaybeUploadEvent(ctx *context.Context, group string, relLocalPath string, remotePath string)

func (*HttpRecorderNotifier) NotifyWebhookEvent

func (b *HttpRecorderNotifier) NotifyWebhookEvent(ctx *context.Context)

type INotifier

type INotifier interface {
	RegisterCallback(s ISubscription)
}

type ISubscription

type ISubscription interface {
	OnFsUpload(req *FsUploadRequest)
}

type Notifier

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

func (*Notifier) Emit

func (n *Notifier) Emit(req *FsUploadRequest)

func (*Notifier) RegisterCallback

func (n *Notifier) RegisterCallback(s ISubscription)

type RegistryConfig

type RegistryConfig struct {
	UpstreamSecret string `yaml:"upstream_secret"`
	UpstreamHost   string `yaml:"upstream_host"`
	UpstreamPort   string `yaml:"upstream_port"`

	Name         string `yaml:"name"`
	Upstream     string `yaml:"upstream"`
	Secret       string `yaml:"secret"`
	RegistryHost string `yaml:"registry_host"`
	RegistryPort string `yaml:"registry_port"`
	ServerHost   string `yaml:"server_host"`
	ServerPort   string `yaml:"server_port"`
	Schema       string `yaml:"schema"`
}

type WebhookNotificationRequest

type WebhookNotificationRequest struct {
	Group      string `url:"group"`
	Path       string `url:"path"`
	RemotePath string `url:"remote"`
}

type WebhookNotificationResponse

type WebhookNotificationResponse struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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