Documentation ¶
Index ¶
- Variables
- type Category
- func (c *Category) Bool(name string, v *bool) error
- func (c *Category) Copy() *Category
- func (c Category) IDVersion() (id int64, version int)
- func (c *Category) Int(name string, v *int) error
- func (c *Category) Set(v ...NameValueType) error
- func (c *Category) String(name string, v *string) error
- func (c *Category) Time(name string, v *time.Time) error
- func (c *Category) Upgrade(new Category) error
- type Document
- type DuplicateNameError
- type Endpoint
- type Feature
- type FileAttr
- type Metadata
- type NameValueType
- type Node
- type NodeContainerInfo
- type NodeReferenceInfo
- type NodeReservationInfo
- type NodeRetrievalError
- type NodeRight
- type NodeRights
- type NodeVersionInfo
- type Permissions
- type Session
- func (s *Session) AddNodeRight(ctx context.Context, id int64, right NodeRight) error
- func (s *Session) AddVersionFile(ctx context.Context, file *FileAttr, r io.Reader) error
- func (s *Session) Call(ctx context.Context, serviceMethod string, args oscript.M, reply interface{}) error
- func (s *Session) CreateDocument(ctx context.Context, doc Document) error
- func (s *Session) CreateFile(ctx context.Context, parent int64, name string, file *FileAttr, r io.Reader) error
- func (s *Session) CreateFolder(ctx context.Context, parentID int64, name, comment string, metadata Metadata) (*Node, error)
- func (s *Session) CreateGroup(ctx context.Context, name string, leaderID *string) (int64, error)
- func (s *Session) CreateNode(ctx context.Context, node *Node) error
- func (s *Session) Debug(w io.Writer) *Session
- func (s *Session) DeleteNode(ctx context.Context, id int64) error
- func (s *Session) GetCategory(ctx context.Context, id int64) (*Category, error)
- func (s *Session) GetNode(ctx context.Context, id int64) (*Node, error)
- func (s *Session) GetNodeByNickname(ctx context.Context, nickname string) (*Node, error)
- func (s *Session) GetNodeRights(ctx context.Context, id int64) (*NodeRights, error)
- func (s *Session) GetSessionExpiration(ctx context.Context) (time.Time, error)
- func (s *Session) GetToken(ctx context.Context, username, password string) (string, error)
- func (s *Session) ReadFile(ctx context.Context, id, version int64, w io.Writer) (*FileAttr, error)
- func (s *Session) RefreshToken(ctx context.Context) (string, error)
- func (s *Session) RemoveNodeRight(ctx context.Context, id int64, right NodeRight) error
- func (s *Session) RenameNode(ctx context.Context, id int64, name string) error
- func (s *Session) ReserveNode(ctx context.Context, id int64, user int64) error
- func (s *Session) UnreserveNode(ctx context.Context, id int64) error
- func (s *Session) UpdateNode(ctx context.Context, node *Node) error
- func (s *Session) UpdateNodeRight(ctx context.Context, id int64, right NodeRight) error
- func (s *Session) UpdateVersion(ctx context.Context, v Version) error
- type TypeValue
- type Value
- type Version
Constants ¶
This section is empty.
Variables ¶
var CacheCategory = &cacheCategory{}
CacheCategory is a cache of the categories.
var (
ErrTokenExpire = fmt.Errorf("ot: token expired")
)
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { DisplayName string `oscript:"DisplayName"` Key string `oscript:"Key"` Type string `oscript:"Type"` Data []Value `oscript:"Values"` // contains filtered or unexported fields }
Category of the node.
type DuplicateNameError ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint represents connection address.
func NewEndpoint ¶
NewEndpoint creates information about connection to the server opentext. No creates connection to server.
type Feature ¶
type Feature struct { Name string `oscript:"Name"` Type string `oscript:"Type"` BooleanValue *bool `oscript:"BooleanValue,omitempty"` DateValue *time.Time `oscript:"DateValue,omitempty"` IntegerValue *int `oscript:"IntegerValue,omitempty"` LongValue *float64 `oscript:"LongValue,omitempty"` StringValue *string `oscript:"StringValue,omitempty"` // contains filtered or unexported fields }
type FileAttr ¶
type FileAttr struct { NodeID int64 `oscript:"-"` Created time.Time `oscript:"CreatedDate"` Modified time.Time `oscript:"ModifiedDate"` Name string `oscript:"Name"` Size int64 `oscript:"DataForkSize"` }
FileAttr information about files.
type Metadata ¶
type Metadata struct { // TODO: Category as pointer Categories []Category `oscript:"AttributeGroups"` // contains filtered or unexported fields }
type NameValueType ¶
func AttrBool ¶
func AttrBool(name string, v bool) NameValueType
func AttrInt ¶
func AttrInt(name string, v int) NameValueType
func AttrNil ¶
func AttrNil(name string) NameValueType
func AttrString ¶
func AttrString(name string, v string) NameValueType
type Node ¶
type Node struct { Catalog int32 `oscript:"Catalog,omitempty"` Comment string `oscript:"Comment"` ContainerInfo NodeContainerInfo `oscript:"ContainerInfo"` CreateDate time.Time `oscript:"CreateDate,omitempty"` CreatedBy int32 `oscript:"CreatedBy,omitempty"` DisplayType string `oscript:"DisplayType"` Feature []Feature `oscript:"Features"` ID int64 `oscript:"ID"` IsContainer bool `oscript:"IsContainer"` IsReference bool `oscript:"IsReference"` IsReservable bool `oscript:"IsReservable"` IsVersional bool `oscript:"IsVersionable"` Metadata Metadata `oscript:"Metadata"` ModifyDate time.Time `oscript:"ModifyDate,omitempty"` Name string `oscript:"Name"` Nickname string `oscript:"Nickname,omitempty"` Parent int64 `oscript:"ParentID"` PartialData bool `oscript:"PartialData"` Permissions Permissions `oscript:"Permissions"` Position int64 `oscript:"Position,omitempty"` ReferenceInfo NodeReferenceInfo `oscript:"ReferenceInfo"` Released bool `oscript:"Released"` ReservationInfo NodeReservationInfo `oscript:"ReservationInfo"` Type string `oscript:"Type"` VersionInfo NodeVersionInfo `oscript:"VersionInfo"` VolumeID int64 `oscript:"VolumeID"` // contains filtered or unexported fields }
type NodeContainerInfo ¶
type NodeReferenceInfo ¶
type NodeReservationInfo ¶
type NodeRetrievalError ¶
func (*NodeRetrievalError) NotFound ¶
func (re *NodeRetrievalError) NotFound() bool
type NodeRight ¶
type NodeRight struct { ID int64 `oscript:"RightID"` Type string `oscript:"Type"` // "ACL", "OwnerGroup", "Owner", "Public" - may be set enum? Perm Permissions `oscript:"Permissions"` // contains filtered or unexported fields }
type NodeRights ¶
type NodeVersionInfo ¶
type NodeVersionInfo struct { AdvancedVersionControl bool `oscript:"AdvancedVersionControl"` FileDataSize int64 `oscript:"FileDataSize"` FileResSize int64 `oscript:"FileResSize"` Major int64 `oscript:"Major"` MimeType string `oscript:"MimeType"` SupportsAdvancedVersionControl bool `oscript:"SupportsAdvancedVersionControl"` VersionNum int64 `oscript:"VersionNum"` Versions []Version `oscript:"Versions"` VersionsToKeep int `oscript:"VersionsToKeep"` // contains filtered or unexported fields }
type Permissions ¶
type Permissions struct { See bool `oscript:"SeePermission"` SeeContent bool `oscript:"SeeContentsPermission"` Modify bool `oscript:"ModifyPermission"` EditAttr bool `oscript:"EditAttributesPermission"` EditPerm bool `oscript:"EditPermissionsPermission"` DeleteVer bool `oscript:"DeleteVersionsPermission"` Delete bool `oscript:"DeletePermission"` Reserve bool `oscript:"ReservePermission"` Create bool `oscript:"AddItemsPermission"` // contains filtered or unexported fields }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session a information about authentication user.
func (*Session) AddNodeRight ¶
func (*Session) AddVersionFile ¶
AddVersionFile adds new version of the file.
func (*Session) Call ¶
func (s *Session) Call(ctx context.Context, serviceMethod string, args oscript.M, reply interface{}) error
Call invokes the service function, waits for it to complete, and returns its error status.
func (*Session) CreateDocument ¶
CreateDocument creates document.
func (*Session) CreateFile ¶
func (s *Session) CreateFile(ctx context.Context, parent int64, name string, file *FileAttr, r io.Reader) error
CreateFile creates a document.
func (*Session) CreateFolder ¶
func (s *Session) CreateFolder(ctx context.Context, parentID int64, name, comment string, metadata Metadata) (*Node, error)
CreateFolder creates folder.
func (*Session) CreateGroup ¶
CreateGroup creates group.
func (*Session) CreateNode ¶
CreateNode creates node.
func (*Session) DeleteNode ¶
DeleteNode deletes node.
func (*Session) GetCategory ¶
GetCategory gets category.
func (*Session) GetNodeByNickname ¶
GetNodeByNickname gets node by nickname.
func (*Session) GetNodeRights ¶
func (*Session) GetSessionExpiration ¶
GetSessionExpiration returns expiration time.
func (*Session) RefreshToken ¶
RefreshToken refreshes or creates token.
func (*Session) RemoveNodeRight ¶
func (*Session) RenameNode ¶
RenameNode renames node.
func (*Session) ReserveNode ¶
ReserveNode reserves node.
func (*Session) UnreserveNode ¶
UnreserveNode unreserves node.
func (*Session) UpdateNode ¶
UpdateNode updates node. Checks on update Catalog, Comment, Name, Position. Always updates the fields Metadata, Nickname.
func (*Session) UpdateNodeRight ¶
type TypeValue ¶
type TypeValue int
func (TypeValue) MarshalOscript ¶
func (*TypeValue) UnmarshalOscript ¶
type Value ¶
type Value struct { Description string `oscript:"Description"` Key string `oscript:"Key"` Value []interface{} `oscript:"Values"` Type TypeValue `oscript:"_SDOName"` }
Value is the attributes of the category.
type Version ¶
type Version struct { Comment string `oscript:"Comment"` CreateDate time.Time `oscript:"CreateDate"` FileCreateDate time.Time `oscript:"FileCreateDate"` FileCreator string `oscript:"FileCreator"` FileDataSize int64 `oscript:"FileDataSize"` FileModifyDate time.Time `oscript:"FileModifyDate"` FileName string `oscript:"Filename"` FilePlatform int `oscript:"FilePlatform"` FileResSize int64 `oscript:"FileResSize"` FileType string `oscript:"FileType"` ID int64 `oscript:"ID"` Locked int `oscript:"Locked"` LockedBy int64 `oscript:"LockedBy,omitempty"` LockedDate time.Time `oscript:"LockedDate"` Metadata Metadata `oscript:"Metadata"` MimeType string `oscript:"MimeType"` ModifyDate time.Time `oscript:"ModifyDate"` Name string `oscript:"Name"` NodeID int64 `oscript:"NodeID"` Number int64 `oscript:"Number"` Owner int64 `oscript:"Owner"` ProviderID int64 `oscript:"ProviderID"` ProviderName string `oscript:"ProviderName"` Type string `oscript:"Type"` VerMajor int64 `oscript:"VerMajor"` VerMinor int64 `oscript:"VerMinor"` // contains filtered or unexported fields }