ocs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShareTypeUser       ShareType = 0
	ShareTypeGroup                = 1
	ShareTypePublicLink           = 3

	PermissionRead      Permission = 1
	PermissionReadWrite Permission = 15

	ItemTypeFile   ItemType = "file"
	ItemTypeFolder ItemType = "folder"

	ShareStateAccepted ShareState = 0
	ShareStatePending             = 1
	ShareStateRejected            = 2
)

Variables

View Source
var SkipDir = errors.New("skip this directory")

Functions

func GetContextWithAuth

func GetContextWithAuth(ctx context.Context) context.Context

func New

func New(opt *Options) (http.Handler, error)

Types

type ItemType

type ItemType string

type JSONInt

type JSONInt struct {
	Value int
	Valid bool
	Set   bool
}

func (*JSONInt) UnmarshalJSON

func (i *JSONInt) UnmarshalJSON(data []byte) error

type JSONString

type JSONString struct {
	Value string
	Valid bool
	Set   bool
}

func (*JSONString) UnmarshalJSON

func (i *JSONString) UnmarshalJSON(data []byte) error

type LDAPAccountType

type LDAPAccountType string
var (
	LDAPAccountTypePrimary   LDAPAccountType = "primary"
	LDAPAccountTypeSecondary LDAPAccountType = "secondary"
	LDAPAccountTypeService   LDAPAccountType = "service"
	LDAPAccountTypeEGroup    LDAPAccountType = "egroup"
	LDAPAccountTypeUnixGroup LDAPAccountType = "unixgroup"
	LDAPAccountTypeUndefined LDAPAccountType = "undefined"
)

type LoadFileResponse

type LoadFileResponse struct {
	FileContents string `json:"filecontents"`
	Writable     bool   `json:"writeable"`
	Mime         string `json:"mime"`
	MTime        int    `json:"mtime"`
}

type NewShareOCSRequest

type NewShareOCSRequest struct {
	Path         string     `json:"path"`
	Name         string     `json:"name"`
	ShareType    ShareType  `json:"shareType"`
	ShareWith    string     `json:"shareWith"`
	PublicUpload bool       `json:"publicUpload"`
	Password     JSONString `json:"password"`
	Permissions  Permission `json:"permissions"`
	ExpireDate   JSONString `json:"expireDate"`
}

type OCSPayload

type OCSPayload struct {
	Meta *ResponseMeta `json:"meta"`
	Data interface{}   `json:"data"`
}

type OCSResponse

type OCSResponse struct {
	OCS *OCSPayload `json:"ocs"`
}

type OCSShare

type OCSShare struct {
	ID                   string     `json:"id"`
	ShareType            ShareType  `json:"share_type"`
	UIDOwner             string     `json:"uid_owner"`
	DisplayNameOwner     string     `json:"displayname_owner"`
	Permissions          Permission `json:"permissions"`
	ShareTime            int        `json:"stime"`
	Token                string     `json:"token"`
	UIDFileOwner         string     `json:"uid_file_owner"`
	DisplayNameFileOwner string     `json:"displayname_file_owner"`
	Path                 string     `json:"path"`
	ItemType             ItemType   `json:"item_type"`
	MimeType             string     `json:"mimetype"`
	ItemSource           string     `json:"item_source"`
	FileSource           string     `json:"file_source"`
	FileTarget           string     `json:"file_target"`
	ShareWith            string     `json:"share_with"`
	ShareWithDisplayName string     `json:"share_with_displayname"`
	Name                 string     `json:"name"`
	URL                  string     `json:"url"`
	State                ShareState `json:"state"`
	Expiration           string     `json:"expiration,omitempty"`
}
{
           "id":"1",
           "share_type":3,
           "uid_owner":"admin",
           "displayname_owner":"admin",
           "permissions":1,
           "stime":1528476368,
           "parent":null,
           "expiration":null,
           "token":"wI9qedAsjltaihj",
           "uid_file_owner":"admin",
           "displayname_file_owner":"admin",
           "path":"\/Reverse cowgirl hotness.mp4",
           "item_type":"file",
           "mimetype":"video\/mp4",
           "storage_id":"home::admin",
           "storage":3,
           "item_source":82,
           "file_source":82,
           "file_parent":25,
           "file_target":"\/Reverse cowgirl hotness.mp4",
           "share_with":null,
           "share_with_displayname":null,
           "name":"Reverse cowgirl hotness.mp4 link",
           "url":"https:\/\/demo.owncloud.org\/s\/wI9qedAsjltaihj",
           "mail_send":0
        }

type OCSShareeData

type OCSShareeData struct {
	Exact   *OCSShareeExact   `json:"exact"`
	Users   []*OCSShareeEntry `json:"users"`
	Groups  []*OCSShareeEntry `json:"groups"`
	Remotes []*OCSShareeEntry `json:"remotes"`
}

type OCSShareeEntry

type OCSShareeEntry struct {
	Label string               `json:"label"`
	Value *OCSShareeEntryValue `json:"value"`
}

type OCSShareeEntryValue

type OCSShareeEntryValue struct {
	ShareType ShareType `json:"shareType"`
	ShareWith string    `json:"shareWith"`
}

type OCSShareeExact

type OCSShareeExact struct {
	Users   []*OCSShareeEntry `json:"users"`
	Groups  []*OCSShareeEntry `json:"groups"`
	Remotes []*OCSShareeEntry `json:"remotes"`
}

type Options

type Options struct {
	Logger *zap.Logger

	REVAHost string
	Router   *mux.Router

	CBOXGroupDaemonURI    string
	CBOXGroupDaemonSecret string

	OwnCloudHomePrefix string
	RevaHomePrefix     string

	OwnCloudSharePrefix string
	RevaSharePrefix     string
}

type Permission

type Permission int

type ResponseMeta

type ResponseMeta struct {
	Status       string `json:"status"`
	StatusCode   int    `json:"statuscode"`
	Message      string `json:"message"`
	TotalItems   string `json:"totalitems"`
	ItemsPerPage string `json:"itemsperpage"`
}

type SaveFileResponse

type SaveFileResponse struct {
	Size  int `json:"size"`
	Mtime int `json:"mtime"`
}

type ShareState

type ShareState int

type ShareType

type ShareType int

type WalkFunc

type WalkFunc func(path string, md *reva_api.Metadata, err error) error

Jump to

Keyboard shortcuts

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