sharefile

package
v0.0.0-...-91bdc37 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceTypeFile    = "File"
	ResourceTypeFolder  = "Folder"
	OperationNameUpload = "Upload"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Subdomain       string `json:"subdomain,omitempty"`
	AppControlPlane string `json:"appcp,omitempty"`
	APIControlPlane string `json:"apicp,omitempty"`
}

func (Account) DownloadAllURL

func (sf Account) DownloadAllURL(sh Share) string

func (Account) DownloadURL

func (sf Account) DownloadURL(sh Share, fileID string) string

type Credentials

type Credentials interface {
	Account() Account
	Do(*http.Request) (*http.Response, error)
}

type File

type File struct {
	Item
}

type Folder

type Folder struct {
	Item
	Name string `json:",omitempty"`
}

type Item

type Item struct {
	ID       string `json:"Id,omitempty"`
	URL      string `json:"url,omitempty"`
	FileName string `json:",omitempty"`
}

func (Item) File

func (item Item) File() (File, error)

func (Item) Folder

func (item Item) Folder() (Folder, error)

type Items

type Items struct {
	Items []Item `json:"value,omitempty"`
}

type Login

type Login struct {
	Credentials
}

func (*Login) CreateFolder

func (sf *Login) CreateFolder(ctx context.Context, name, parentFolderId string) (Folder, error)

func (Login) CreateRequestShare

func (sf Login) CreateRequestShare(ctx context.Context, parentFolderId string) (Share, error)

func (Login) CreateSendShare

func (sf Login) CreateSendShare(ctx context.Context, files []File) (Share, error)

func (Login) CreateShare

func (sf Login) CreateShare(ctx context.Context, toCreate Share) (Share, error)

func (*Login) CreateSubscription

func (sf *Login) CreateSubscription(ctx context.Context, toCreate WebhookSubscription) (WebhookSubscription, error)

func (*Login) DeleteSubscription

func (sf *Login) DeleteSubscription(ctx context.Context, subscriptionID string) error

func (*Login) GetChildren

func (sf *Login) GetChildren(ctx context.Context, parentFolderId string) ([]Item, error)

func (*Login) Subscribe

func (sf *Login) Subscribe(ctx context.Context, folder Folder, callbackURL string, eventTypes ...string) (WebhookSubscription, error)

func (Login) UpdateSendShare

func (sf Login) UpdateSendShare(ctx context.Context, share Share, files []File) (Share, error)

func (Login) UpdateShare

func (sf Login) UpdateShare(ctx context.Context, toUpdate Share) (Share, error)

type Share

type Share struct {
	ID        string  `json:"Id,omitempty"`
	URL       string  `json:"url,omitempty"`
	ShareType string  `json:",omitempty"`
	Parent    *Folder `json:",omitempty"`
	Items     []File  `json:",omitempty"`
	URI       string  `json:"Uri,omitempty"`
}

type SubscribedResource

type SubscribedResource struct {
	ID     string              `json:"Id,omitempty"`
	Parent *SubscribedResource `json:",omitempty"`
}

type SubscribedResourceEvent

type SubscribedResourceEvent struct {
	ResourceType  string `json:",omitempty"`
	OperationName string `json:",omitempty"`
}

type SubscriptionContext

type SubscriptionContext struct {
	ResourceType string `json:",omitempty"`
	ResourceId   string `json:",omitempty"`
}

type SubscriptionEvent

type SubscriptionEvent struct {
	Timestamp     time.Time          `json:",omitempty"`
	OperationName string             `json:",omitempty"`
	ResourceType  string             `json:",omitempty"`
	Resource      SubscribedResource `json:",omitempty"`
}

type WebhookSubscription

type WebhookSubscription struct {
	ID                  string                    `json:"Id,omitempty"`
	URL                 string                    `json:"url,omitempty"`
	SubscriptionContext SubscriptionContext       `json:",omitempty"`
	Events              []SubscribedResourceEvent `json:",omitempty"`
	WebhookURL          string                    `json:"WebhookUrl,omitempty"`
}

type WebhookSubscriptionEvent

type WebhookSubscriptionEvent struct {
	WebhookSubscriptionID string            `json:"WebhookSubscriptionId,omitempty"`
	AccountID             string            `json:"AccountId,omitempty"`
	Event                 SubscriptionEvent `json:",omitempty"`
}

func ParseEvent

func ParseEvent(rdr io.Reader) (WebhookSubscriptionEvent, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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