server

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTranslationProgress

func CheckTranslationProgress(urn string, token string) (progress string, err error)

CheckTranslationProgress will check the status of the work and will return progress either "complete" or as percent value

func CreateTransientBucket

func CreateTransientBucket(bucketName string, token string) (bucketKey string, err error)

CreateTransientBucket is responsible for creation of a transient bucket given the bucket name

func StartServer

func StartServer(port string)

StartServer is responsible for setting up and lunching a simple web-server on the specified port

func TranslateSourceToSVF

func TranslateSourceToSVF(objectID string, token string) (urn string, err error)

TranslateSourceToSVF takes care of base64 conversion of objectID and returns the URN for which translation was started

func UploadAndConvert

func UploadAndConvert(filename string, data []byte, token string) (urn string, err error)

UploadAndConvert takes cares of file uploading and translation, given the file and access token

func UploadDataIntoBucket

func UploadDataIntoBucket(filename string, data []byte, bucketKey string, token string) (objectID string, err error)

UploadDataIntoBucket is responsible for uploading the received file into given bucket

Types

type BucketParams

type BucketParams struct {
	BucketKey string `json:"bucketKey"`
	PolicyKey string `json:"policyKey"`
}

BucketParams struct reflects the Bucket Creation parameters

type CreateBucketResponse

type CreateBucketResponse struct {
	BucketKey   string `json:"bucketKey"`
	BucketOwner string `json:"bucketOwner"`
	CreatedDate int64  `json:"createdDate"`
	Permissions []struct {
		AuthID string `json:"authId"`
		Access string `json:"access"`
	} `json:"permissions"`
	PolicyKey string `json:"policyKey"`
}

CreateBucketResponse reflects the the data returned upon creating a bucket

type ForgeServices

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

ForgeServices holds the necessary references to Forge services

type Format

type Format struct {
	Type  string   `json:"type"`
	Views []string `json:"views"`
}

Format struct is part of TranslationParams struct and reflects the type to be translated to and the views

type TranslationParams

type TranslationParams struct {
	Input struct {
		URN string `json:"urn"`
	} `json:"input"`
	Output struct {
		Formats []Format `json:"formats"`
	} `json:"output"`
}

TranslationParams reflects the data and the structure necessary to start a translation job

type TranslationResponse

type TranslationResponse struct {
	Result string `json:"result"`
	URN    string `json:"urn"`
}

TranslationResponse struct reflects the necessary data returned upon starting file translation

type TranslationStatusResponse

type TranslationStatusResponse struct {
	Type     string `json:"type"`
	Status   string `json:"status"`
	Progress string `json:"progress"`
	Region   string `json:"region"`
	URN      string `json:"urn"`
	Version  string `json:"version"`
}

TranslationStatusResponse reflect the data returned when checking for translation status

type UploadFileToBucketResponse

type UploadFileToBucketResponse struct {
	BucketKey   string `json:"bucketKey"`
	ObjectID    string `json:"objectId"`
	ObjectKey   string `json:"objectKey"`
	SHA1        string `json:"sha1"`
	Size        int64  `json:"size"`
	ContentType string `json:"contentType"`
	Location    string `json:"location"`
}

UploadFileToBucketResponse struct reflects the data returned upon file uploading into a bucket

Jump to

Keyboard shortcuts

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