share

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AutoShare indicates that the sharing link was created automatically.
	AutoShare = "Auto Share"
	// LinkToShare indicates that the sharing link was created manually.
	LinkToShare = "Link to Share"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Share

type Share struct {
	// State is the current status of the shared link.
	State State
	// Title is the name or title of the shared link.
	Title string
	// HostSharedLink is the shared link that can be used to share and forward to others.
	HostSharedLink string
	// OriginalLink is the original link used to generate this share.
	OriginalLink string
	// CreatedBy is the creator of this shared link.
	CreatedBy string
	// CreatedAt is the time when the shared link was created
	CreatedAt time.Time
	// Size is the total size of all files included in this shared link.
	Size int64
	// Statistics is the statistical data of this shared link
	Statistics
}

Share contains all information of a shared link.

type State

type State string

State is the current status of some shared link.

const (
	StatusPending   State = "PENDING" // batch add "link to share" will create a pending task first
	StatusUnknown   State = "UNKNOWN"
	StatusCreated   State = "CREATED"
	StatusOK        State = "OK"
	StatusDeleted   State = "DELETED"
	StatusNotFound  State = "NOT_FOUND"
	StatusSensitive State = "SENSITIVE" // the content corresponding to the link contains sensitive resources.
	StatusBlocked   State = "BLOCKED"   // blocked by user self.
	StatusError     State = "ERROR"
)

Enum all Statuses.

func StatusFromFileStatus

func StatusFromFileStatus(s string) State

StatusFromFileStatus returns the status of shared link corresponding to the status of file.

func (State) String

func (s State) String() string

type Statistics

type Statistics struct {
	// Visitor is the number of times the shared link was viewed by other users
	Visitor int32
	// Stored is the number of times the shared link was saved by other users
	Stored int32
	// Revenue is the total revenue of this shared link in SGD cents.
	Revenue int64
}

Statistics is the statistical data of this shared link.

Jump to

Keyboard shortcuts

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