ftrack

package
v0.0.0-...-d474664 Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncodeDatetimeFormat string = "YYYY-MM-DDTHH:mm:ss"
	ServerLocationId     string = "3a372bde-05bc-11e4-8908-20c9d081909b"
	DefaultApiEndpoint   string = "/api"
	EntityTypeKey        string = "__entity_type__"
)

Variables

This section is empty.

Functions

func GetEntityType

func GetEntityType(entity interface{}) (string, error)

func IsDate

func IsDate(data interface{}) bool

func IsEntity

func IsEntity(entity interface{}) bool

func NormalizeString

func NormalizeString(str string) string

Types

type AsyncCallResult

type AsyncCallResult struct {
	Result []interface{}
	Err    error
}

type AsyncQueryResult

type AsyncQueryResult struct {
	Result *QueryResult
	Err    error
}

type CreateComponentOptions

type CreateComponentOptions struct {
	Id         *uuid.UUID
	OnProgress *func(int)
	OnAborted  *func()
	FileType   *string
	FileSize   *int64
	FileName   *string
	// contains filtered or unexported fields
}

type CreateOperation

type CreateOperation struct {
	Action     string                 `json:"action"`
	EntityType string                 `json:"entity_type"`
	EntityData map[string]interface{} `json:"entity_data"`
}

func NewCreateOperation

func NewCreateOperation(entityType string, data map[string]interface{}) CreateOperation

func (CreateOperation) ResultFactory

func (op CreateOperation) ResultFactory(session *Session) *CreateResult

type CreateResult

type CreateResult struct {
	Action   string                 `json:"action"`
	Data     map[string]interface{} `json:"data"`
	Metadata map[string]interface{} `json:"metadata"`
}

func (*CreateResult) DecodeResult

func (r *CreateResult) DecodeResult(session *Session, identityMap map[string]map[string]interface{})

type DecodeError

type DecodeError struct {
	// contains filtered or unexported fields
}

func (*DecodeError) Error

func (error *DecodeError) Error() string

type DeleteOperation

type DeleteOperation struct {
	Action     string   `json:"action"`
	EntityType string   `json:"entity_type"`
	EntityKey  []string `json:"entity_key"`
}

func NewDeleteOperation

func NewDeleteOperation(entityType string, keys []string) DeleteOperation

func (DeleteOperation) ResultFactory

func (op DeleteOperation) ResultFactory(session *Session) *DeleteResult

type DeleteResult

type DeleteResult struct {
	Action string `json:"action"`
	Data   bool   `json:"data"`
}

func (*DeleteResult) DecodeResult

func (r *DeleteResult) DecodeResult(session *Session, identityMap map[string]map[string]interface{})

type EncodeError

type EncodeError struct {
	// contains filtered or unexported fields
}

func (*EncodeError) Error

func (error *EncodeError) Error() string

type ErrorResponse

type ErrorResponse struct {
	Content   string `json:"content"`
	Exception string `json:"exception"`
	ErrorCode int    `json:"error_code"`
}

type GetUploadMetadataOperation

type GetUploadMetadataOperation struct {
	Action      string    `json:"action"`
	FileName    string    `json:"file_name"`
	FileSize    int64     `json:"file_size"`
	ComponentId uuid.UUID `json:"component_id"`
}

func NewGetUploadMetadataOperation

func NewGetUploadMetadataOperation(fileName string, fileSize int64, componentId uuid.UUID) GetUploadMetadataOperation

func (GetUploadMetadataOperation) ResultFactory

func (op GetUploadMetadataOperation) ResultFactory(session *Session) *GetUploadMetadataResult

type GetUploadMetadataResult

type GetUploadMetadataResult struct {
	Url     string            `json:"url"`
	Headers map[string]string `json:"headers"`
}

func (*GetUploadMetadataResult) DecodeResult

func (r *GetUploadMetadataResult) DecodeResult(session *Session, identityMap map[string]map[string]interface{})

type MalformedResponseError

type MalformedResponseError struct {
	Content []byte
}

func (*MalformedResponseError) Error

func (error *MalformedResponseError) Error() string

type QueryInformationOperation

type QueryInformationOperation struct {
	Action string   `json:"action"`
	Values []string `json:"values"`
}

func NewQueryInformationOperation

func NewQueryInformationOperation(values []string) QueryInformationOperation

func (QueryInformationOperation) ResultFactory

func (op QueryInformationOperation) ResultFactory(session *Session) *QueryInformationResult

type QueryInformationResult

type QueryInformationResult map[string]interface{}

func (*QueryInformationResult) DecodeResult

func (r *QueryInformationResult) DecodeResult(session *Session, identityMap map[string]map[string]interface{})

type QueryOperation

type QueryOperation struct {
	Action     string `json:"action"`
	Expression string `json:"expression"`
}

func NewQueryOperation

func NewQueryOperation(expression string) QueryOperation

func (QueryOperation) ResultFactory

func (op QueryOperation) ResultFactory(session *Session) *QueryResult

type QueryResult

type QueryResult struct {
	Action   string                   `json:"action"`
	Data     []map[string]interface{} `json:"data"`
	Metadata map[string]interface{}   `json:"metadata"`
}

func (*QueryResult) DecodeResult

func (r *QueryResult) DecodeResult(session *Session, identityMap map[string]map[string]interface{})

type QuerySchemasOperation

type QuerySchemasOperation struct {
	Action string `json:"action"`
}

func NewQuerySchemasOperation

func NewQuerySchemasOperation() QuerySchemasOperation

func (QuerySchemasOperation) ResultFactory

func (op QuerySchemasOperation) ResultFactory(session *Session) *QuerySchemasResult

type QuerySchemasResult

type QuerySchemasResult []map[string]interface{}

func (*QuerySchemasResult) DecodeResult

func (r *QuerySchemasResult) DecodeResult(session *Session, identityMap map[string]map[string]interface{})

type ServerError

type ServerError struct {
	Msg       string
	ErrorCode int
	Exception string
}

func (*ServerError) Error

func (error *ServerError) Error() string

type ServerPermissionDeniedError

type ServerPermissionDeniedError ServerError

func (*ServerPermissionDeniedError) Error

func (error *ServerPermissionDeniedError) Error() string

type ServerValidationError

type ServerValidationError ServerError

func (*ServerValidationError) Error

func (error *ServerValidationError) Error() string

type Session

type Session struct {
	ServerUrl         string
	ApiUser           string
	ApiKey            string
	ApiEndpoint       string
	ClientToken       string
	Timeout           time.Duration
	ServerVersion     string
	Initialized       bool
	Schemas           QuerySchemasResult
	SchemasMap        map[string]map[string]interface{}
	ServerInformation QueryInformationResult
	// contains filtered or unexported fields
}

func NewSession

func NewSession(config SessionConfig) (*Session, error)

func (*Session) AsyncCall

func (session *Session) AsyncCall(operations ...interface{}) <-chan AsyncCallResult

func (*Session) AsyncQuery

func (session *Session) AsyncQuery(expression string) <-chan AsyncQueryResult

func (*Session) Call

func (session *Session) Call(operations ...interface{}) ([]interface{}, error)

func (*Session) Create

func (session *Session) Create(entityType string, data map[string]interface{}) (*CreateResult, error)

func (*Session) CreateComponent

func (session *Session) CreateComponent(fileName string, options CreateComponentOptions) (result []CreateResult, err error)

func (*Session) Decode

func (session *Session) Decode(data interface{}, identityMap map[string]map[string]interface{}) interface{}

func (*Session) Delete

func (session *Session) Delete(entityType string, id []string) (*DeleteResult, error)

func (*Session) Encode

func (session *Session) Encode(data interface{}) interface{}

func (*Session) EnsurePopulated

func (session *Session) EnsurePopulated(data interface{}, keys []string) (map[string]interface{}, error)

func (*Session) GetComponentUrl

func (session *Session) GetComponentUrl(componentId uuid.UUID) string

func (*Session) GetIdentifyingKey

func (session *Session) GetIdentifyingKey(entity map[string]interface{}) (string, error)

func (*Session) GetPrimaryKeyAttributes

func (session *Session) GetPrimaryKeyAttributes(entityType string) []string

func (*Session) GetSchema

func (session *Session) GetSchema(schemaId string) map[string]interface{}

func (*Session) GetThumbnailUrl

func (session *Session) GetThumbnailUrl(componentId uuid.UUID, size int) string

func (*Session) Query

func (session *Session) Query(expression string) (*QueryResult, error)

func (*Session) Update

func (session *Session) Update(entityType string, keys []string, data map[string]interface{}) (*UpdateResult, error)

type SessionConfig

type SessionConfig struct {
	ApiUser     string
	ApiKey      string
	ServerUrl   string
	ApiEndpoint string
	ClientToken string
	Timeout     time.Duration
}

type UpdateOperation

type UpdateOperation struct {
	Action     string                 `json:"action"`
	EntityType string                 `json:"entity_type"`
	EntityData map[string]interface{} `json:"entity_data"`
	EntityKey  []string               `json:"entity_key"`
}

func NewUpdateOperation

func NewUpdateOperation(entityType string, keys []string, data map[string]interface{}) UpdateOperation

func (UpdateOperation) ResultFactory

func (op UpdateOperation) ResultFactory(session *Session) *UpdateResult

type UpdateResult

type UpdateResult CreateResult

func (*UpdateResult) DecodeResult

func (r *UpdateResult) DecodeResult(session *Session, identityMap map[string]map[string]interface{})

Jump to

Keyboard shortcuts

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