common

package
v0.0.0-...-cba5bb6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Zlib Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EMPTY_STATUS = &UserStatusOutput{
	PaymentID: "WILL-BE-IN-YOUR-EMAIL",
	Email:     "your.email@example.com",
	Tokens: []*TokenOutput{
		&TokenOutput{
			ID:        0,
			UUID:      "TOKEN-UUID-A",
			WriteOnly: false,
			Name:      "db-example-a",
		},
		&TokenOutput{
			ID:        0,
			UUID:      "TOKEN-UUID-B",
			WriteOnly: false,
			Name:      "content-example-b",
		},
	},
}

Functions

func GetUUID

func GetUUID() string

func PrettySize

func PrettySize(b uint64) string

Types

type AgeNotification

type AgeNotification struct {
	ActualAge time.Duration
	Overdue   time.Duration
}

type ChangeEmailInput

type ChangeEmailInput struct {
	NewEmail string `binding:"required" json:"new_email"`
}

type ChangePasswordInput

type ChangePasswordInput struct {
	NewPassword string `binding:"required" json:"new_password"`
}

type CreateTokenInput

type CreateTokenInput struct {
	WriteOnly bool   `json:"write_only"`
	Name      string `json:"name"`
}

type CreateUserInput

type CreateUserInput struct {
	Email    string `binding:"required" json:"email"`
	Password string `binding:"required" json:"password"`
}

type DeleteSuccess

type DeleteSuccess struct {
	Success bool `json:"success"`
	Count   int  `json:"deleted"`
}

type DeleteTokenInput

type DeleteTokenInput struct {
	UUID string `binding:"required" json:"token"`
}

type FileNotification

type FileNotification struct {
	Age             *AgeNotification
	Size            *SizeNotification
	FullPath        string
	LastVersionSize uint64
	FileVersionID   uint64
	FileMetadataID  uint64
	CreatedAt       time.Time
}

type Force

type Force struct {
	Force     *bool `json:"force"`
	Recursive *bool `json:"recursive"`
}

type LocalFile

type LocalFile struct {
	File           *os.File
	SHA            string
	Size           uint64
	TempName       string
	OriginFullPath string
}

type ModifyTokenInput

type ModifyTokenInput struct {
	WriteOnly *bool  `json:"write_only"`
	Name      string `json:"name"`
	UUID      string `binding:"required" json:"token"`
}

type QueryError

type QueryError struct {
	Error string `json:"error"`
}

type SizeNotification

type SizeNotification struct {
	PreviousSize uint64
	Delta        float64
}

type Success

type Success struct {
	Success bool `json:"success"`
}

type TokenOutput

type TokenOutput struct {
	UUID       string    `json:"token"`
	ID         uint64    `json:"id"`
	WriteOnly  bool      `json:"write_only"`
	Name       string    `json:"name"`
	CreatedAt  time.Time `json:"created_at"`
	SizeUsed   uint64    `json:"size_used"`
	InodesUsed uint64    `json:"inodes_used"`
}

type UserStatusOutput

type UserStatusOutput struct {
	EmailVerified         *time.Time     `json:"email_verified"`
	Paid                  bool           `json:"paid"`
	StartedSubscription   *time.Time     `json:"started_subscription"`
	CancelledSubscription *time.Time     `json:"cancelled_subscription"`
	PaymentID             string         `json:"payment_id"`
	SubscribeURL          string         `json:"subscribe_url"`
	CancelSubscriptionURL string         `json:"cancel_subscription_url"`
	LastVerificationID    string         `json:"-"`
	UserID                uint64         `json:"-"`
	Tokens                []*TokenOutput `json:"tokens"`
	Email                 string         `json:"email"`
	Quota                 uint64         `json:"quota"`
	QuotaUsed             uint64         `json:"quota_used"`
	QuotaInode            uint64         `json:"quota_inodes"`
	QuotaInodeUsed        uint64         `json:"quota_inodes_used"`
}

Jump to

Keyboard shortcuts

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