Documentation ¶
Index ¶
- Constants
- func GetEntityType(entity interface{}) (string, error)
- func IsDate(data interface{}) bool
- func IsEntity(entity interface{}) bool
- func NormalizeString(str string) string
- type AsyncCallResult
- type AsyncQueryResult
- type CreateComponentOptions
- type CreateOperation
- type CreateResult
- type DecodeError
- type DeleteOperation
- type DeleteResult
- type EncodeError
- type ErrorResponse
- type GetUploadMetadataOperation
- type GetUploadMetadataResult
- type MalformedResponseError
- type QueryInformationOperation
- type QueryInformationResult
- type QueryOperation
- type QueryResult
- type QuerySchemasOperation
- type QuerySchemasResult
- type ServerError
- type ServerPermissionDeniedError
- type ServerValidationError
- type Session
- func (session *Session) AsyncCall(operations ...interface{}) <-chan AsyncCallResult
- func (session *Session) AsyncQuery(expression string) <-chan AsyncQueryResult
- func (session *Session) Call(operations ...interface{}) ([]interface{}, error)
- func (session *Session) Create(entityType string, data map[string]interface{}) (*CreateResult, error)
- func (session *Session) CreateComponent(fileName string, options CreateComponentOptions) (result []CreateResult, err error)
- func (session *Session) Decode(data interface{}, identityMap map[string]map[string]interface{}) interface{}
- func (session *Session) Delete(entityType string, id []string) (*DeleteResult, error)
- func (session *Session) Encode(data interface{}) interface{}
- func (session *Session) EnsurePopulated(data interface{}, keys []string) (map[string]interface{}, error)
- func (session *Session) GetComponentUrl(componentId uuid.UUID) string
- func (session *Session) GetIdentifyingKey(entity map[string]interface{}) (string, error)
- func (session *Session) GetPrimaryKeyAttributes(entityType string) []string
- func (session *Session) GetSchema(schemaId string) map[string]interface{}
- func (session *Session) GetThumbnailUrl(componentId uuid.UUID, size int) string
- func (session *Session) Query(expression string) (*QueryResult, error)
- func (session *Session) Update(entityType string, keys []string, data map[string]interface{}) (*UpdateResult, error)
- type SessionConfig
- type UpdateOperation
- type UpdateResult
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 NormalizeString ¶
Types ¶
type AsyncCallResult ¶
type AsyncCallResult struct { Result []interface{} Err error }
type AsyncQueryResult ¶
type AsyncQueryResult struct { Result *QueryResult Err error }
type CreateComponentOptions ¶
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 ¶
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 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 ¶
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 ¶
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) 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) Delete ¶
func (session *Session) Delete(entityType string, id []string) (*DeleteResult, error)
func (*Session) EnsurePopulated ¶
func (*Session) GetComponentUrl ¶
func (*Session) GetIdentifyingKey ¶
func (*Session) GetPrimaryKeyAttributes ¶
func (*Session) GetThumbnailUrl ¶
type SessionConfig ¶
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{})
Click to show internal directories.
Click to hide internal directories.