stores

package
v0.0.0-...-e40a8b4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 20 Imported by: 0

README

Telestream Cloud Stores Service Go SDK

This library provides a low-level interface to the REST API of Telestream Cloud, the online video encoding service.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version: 2.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Documentation for API Endpoints

All URIs are relative to https://api.cloud.telestream.net/stores/v1.1

Class Method HTTP request Description
StoresApi CreateStore Post /stores
StoresApi CreateStoreClientLink Post /stores/{store_id}/service/{service_name}/id/{service_id}
StoresApi CreateWatchRule Post /watch_rules
StoresApi DeleteStore Delete /stores/{id}
StoresApi DeleteStoreClientLink Delete /stores/{store_id}/service/{service_name}/id/{service_id}
StoresApi DeleteWatchRule Delete /watch_rules/{id}
StoresApi GetObjectUrl Get /stores/{id}/object_url
StoresApi GetStore Get /stores/{id}
StoresApi GetStoreIdsForClient Get /stores/service/{service_name}/id/{service_id}
StoresApi GetStores Get /stores
StoresApi GetWatchRule Get /watch_rules/{id}
StoresApi GetWatchRules Get /watch_rules
StoresApi SyncWatchRule Post /watch_rules/{id}/sync
StoresApi UpdateStore Patch /stores/{id}
StoresApi UpdateWatchRule Patch /watch_rules/{id}
StoresApi ValidateBucket Post /validate_bucket

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key

Example

	auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
		Key: "APIKEY",
		Prefix: "Bearer", // Omit if not necessary.
	})
    r, err := client.Service.Operation(auth, args)

Author

you@your-company.com

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {

	// API Services
	StoresApi *StoresApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the API API v1.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type AlternativePathFormat

type AlternativePathFormat struct {
	Formats []string `json:"formats,omitempty"`
}

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type ErrorResponse

type ErrorResponse struct {
	Errors []ModelError `json:"errors,omitempty"`
}

type ModelError

type ModelError struct {
	Field string `json:"field,omitempty"`

	Message string `json:"message,omitempty"`
}

type ObjectUrl

type ObjectUrl struct {
	Url string `json:"url,omitempty"`
}

type Output

type Output struct {
	Id string `json:"id,omitempty"`

	PathFormat string `json:"path_format,omitempty"`

	StoreId string `json:"store_id,omitempty"`

	ServiceId string `json:"service_id,omitempty"`

	ServiceName string `json:"service_name,omitempty"`
}

type Store

type Store struct {
	Id string `json:"id,omitempty"`

	Name string `json:"name,omitempty"`

	Provider string `json:"provider,omitempty"`

	AccountId string `json:"account_id,omitempty"`

	BucketName string `json:"bucket_name,omitempty"`

	InputStore bool `json:"input_store,omitempty"`

	WatchInterval int32 `json:"watch_interval,omitempty"`

	Region string `json:"region,omitempty"`

	PrivateAccess bool `json:"private_access,omitempty"`

	AccessKey string `json:"access_key,omitempty"`

	SecretKey string `json:"secret_key,omitempty"`

	BaseUploadUrl string `json:"base_upload_url,omitempty"`

	ProviderSpecificSettings *StoreBodyProviderSpecificSettings `json:"provider_specific_settings,omitempty"`
}

type StoreBody

type StoreBody struct {
	Name string `json:"name"`

	Provider string `json:"provider"`

	BucketName string `json:"bucket_name"`

	Region string `json:"region"`

	PrivateAccess bool `json:"private_access,omitempty"`

	AccessKey string `json:"access_key"`

	SecretKey string `json:"secret_key"`

	ProviderSpecificSettings *StoreBodyProviderSpecificSettings `json:"provider_specific_settings,omitempty"`
}

type StoreBodyProviderSpecificSettings

type StoreBodyProviderSpecificSettings struct {
	Host string `json:"host,omitempty"`

	Port string `json:"port,omitempty"`

	CacheControl string `json:"cache_control,omitempty"`

	Metadata string `json:"metadata,omitempty"`

	FaspPort string `json:"fasp_port,omitempty"`

	SshPort string `json:"ssh_port,omitempty"`

	MaxRate string `json:"max_rate,omitempty"`

	MinRate string `json:"min_rate,omitempty"`

	Policy string `json:"policy,omitempty"`
}

type StoresApiService

type StoresApiService service

func (*StoresApiService) CreateStore

func (a *StoresApiService) CreateStore(ctx context.Context, storeBody StoreBody) (Store, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param storeBody @return Store

func (a *StoresApiService) CreateStoreClientLink(ctx context.Context, storeId string, serviceName string, serviceId string) (*http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param storeId an id of a store @param serviceName a name of a client service @param serviceId a service id of a resource that queries for its stores @return

func (*StoresApiService) CreateWatchRule

func (a *StoresApiService) CreateWatchRule(ctx context.Context, watchRuleBody WatchRule) (WatchRule, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param watchRuleBody @return WatchRule

func (*StoresApiService) DeleteStore

func (a *StoresApiService) DeleteStore(ctx context.Context, id string) (*http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a store @return

func (a *StoresApiService) DeleteStoreClientLink(ctx context.Context, storeId string, serviceName string, serviceId string) (*http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param storeId an id of a store @param serviceName a name of a client service @param serviceId a service id of a resource that queries for its stores @return

func (*StoresApiService) DeleteWatchRule

func (a *StoresApiService) DeleteWatchRule(ctx context.Context, id string) (*http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a resource @return

func (*StoresApiService) GetObjectUrl

func (a *StoresApiService) GetObjectUrl(ctx context.Context, id string, path string, expiresIn string) (ObjectUrl, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a store @param path an path to a file @param expiresIn expiration time in seconds @return ObjectUrl

func (*StoresApiService) GetStore

func (a *StoresApiService) GetStore(ctx context.Context, id string) (Store, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a store @return Store

func (*StoresApiService) GetStoreIdsForClient

func (a *StoresApiService) GetStoreIdsForClient(ctx context.Context, serviceName string, serviceId string) ([]string, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param serviceName a name of a client service @param serviceId a service id of a resource that queries for its stores @return []string

func (*StoresApiService) GetStores

func (a *StoresApiService) GetStores(ctx context.Context, localVarOptionals map[string]interface{}) ([]Store, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param optional (nil or map[string]interface{}) with one or more of:

@param "bucketName" (string) filter stores by bucket_name
@param "provider" (string) filter stores by storage provider

@return []Store

func (*StoresApiService) GetWatchRule

func (a *StoresApiService) GetWatchRule(ctx context.Context, id string) (WatchRule, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a watch rule @return WatchRule

func (*StoresApiService) GetWatchRules

func (a *StoresApiService) GetWatchRules(ctx context.Context, localVarOptionals map[string]interface{}) ([]WatchRule, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param optional (nil or map[string]interface{}) with one or more of:

@param "serviceId" (string) filter watch rules by service_id
@param "storeId" (string) filter watch rules by store_id

@return []WatchRule

func (*StoresApiService) SyncWatchRule

func (a *StoresApiService) SyncWatchRule(ctx context.Context, id string) (*http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a watch rule @return

func (*StoresApiService) UpdateStore

func (a *StoresApiService) UpdateStore(ctx context.Context, id string, storeBody StoreBody) (Store, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a store @param storeBody @return Store

func (*StoresApiService) UpdateWatchRule

func (a *StoresApiService) UpdateWatchRule(ctx context.Context, id string, watchRuleBody WatchRule) (WatchRule, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param id an id of a watch rule @param watchRuleBody @return WatchRule

func (*StoresApiService) ValidateBucket

func (a *StoresApiService) ValidateBucket(ctx context.Context, validateBucketBody ValidateBucketBody) (ValidateBucketResponse, *http.Response, error)

StoresApiService * @param ctx context.Context for authentication, logging, tracing, etc. @param validateBucketBody @return ValidateBucketResponse

type ValidateBucketBody

type ValidateBucketBody struct {
	BucketName string `json:"bucket_name,omitempty"`

	Provider string `json:"provider,omitempty"`

	Region string `json:"region,omitempty"`

	AccessKey string `json:"access_key,omitempty"`

	SecretKey string `json:"secret_key,omitempty"`
}

type ValidateBucketResponse

type ValidateBucketResponse struct {
	Status string `json:"status,omitempty"`
}

type WatchRule

type WatchRule struct {
	Id string `json:"id,omitempty"`

	StoreId string `json:"store_id,omitempty"`

	ServiceId string `json:"service_id,omitempty"`

	ServiceName string `json:"service_name,omitempty"`

	Filters *interface{} `json:"filters,omitempty"`

	SyncScheduledAt time.Time `json:"sync_scheduled_at,omitempty"`

	Synced bool `json:"synced,omitempty"`

	Enabled bool `json:"enabled,omitempty"`
}

Jump to

Keyboard shortcuts

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