_123Link

package
v3.37.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: AGPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignURL

func SignURL(originURL, privateKey string, uid uint64, validDuration time.Duration) (newURL string, err error)

Types

type Addition

type Addition struct {
	OriginURLs    string `` /* 156-byte string literal not displayed */
	PrivateKey    string `json:"private_key"`
	UID           uint64 `json:"uid" type:"number"`
	ValidDuration int64  `json:"valid_duration" type:"number" default:"30" help:"minutes"`
}

type Node

type Node struct {
	Url      string
	Name     string
	Level    int
	Modified int64
	Size     int64
	Children []*Node
}

Node is a node in the folder tree

func BuildTree

func BuildTree(text string) (*Node, error)

build tree from text, text structure definition: *

  • FolderName:
  • [FileSize:][Modified:]Url

*

  • For example:
  • folder1:
  • name1:url1
  • url2
  • folder2:
  • url3
  • url4
  • url5
  • folder3:
  • url6
  • url7
  • url8

if there are no name, use the last segment of url as name

func GetNodeFromRootByPath

func GetNodeFromRootByPath(root *Node, path string) *Node
type Pan123Link struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*Pan123Link) Config

func (d *Pan123Link) Config() driver.Config

func (*Pan123Link) Drop

func (d *Pan123Link) Drop(ctx context.Context) error

func (*Pan123Link) Get

func (d *Pan123Link) Get(ctx context.Context, path string) (model.Obj, error)

func (*Pan123Link) GetAddition

func (d *Pan123Link) GetAddition() driver.Additional

func (*Pan123Link) Init

func (d *Pan123Link) Init(ctx context.Context) error
func (d *Pan123Link) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*Pan123Link) List

func (d *Pan123Link) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

Jump to

Keyboard shortcuts

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