swagger

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 21 Imported by: 0

README

Go API client for swagger

Cloud-native media hosting & streaming server for businesses.

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: v1
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to http://demo-v1.gilfoyle.dreamvo.com

Class Method HTTP request Description
AttachmentsApi AddMediaAttachment Post /medias/{media_id}/attachments/{key} Add attachment to a media
AttachmentsApi DeleteMediaAttachment Delete /medias/{media_id}/attachments/{key} Delete attachment of a media
AttachmentsApi GetMediaAttachments Get /medias/{media_id}/attachments Get attachments of a media
InstanceApi CheckHealth Get /healthz Check service status
MediasApi CreateMedia Post /medias Create a media
MediasApi DeleteMedia Delete /medias/{id} Delete a media
MediasApi GetAllMedias Get /medias Query medias
MediasApi GetMedia Get /medias/{id} Get a media
MediasApi UpdateMedia Patch /medias/{id} Update a media
MediasApi UploadAudio Post /medias/{id}/upload/audio Upload a audio file
MediasApi UploadVideo Post /medias/{id}/upload/video Upload a video file
StreamApi GetMediaPlaylistFile Get /medias/{media_id}/stream/{filename} Get HLS playlist file of a media

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

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 {
	AttachmentsApi *AttachmentsApiService

	InstanceApi *InstanceApiService

	MediasApi *MediasApiService

	StreamApi *StreamApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Gilfoyle server API vv1 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 ApiCreateMedia

type ApiCreateMedia struct {
	Title string `json:"title"`
}

type ApiFileFormat

type ApiFileFormat struct {
	BitRate        string `json:"bit_rate,omitempty"`
	Duration       string `json:"duration,omitempty"`
	Filename       string `json:"filename,omitempty"`
	FormatLongName string `json:"format_long_name,omitempty"`
	FormatName     string `json:"format_name,omitempty"`
	NbPrograms     int32  `json:"nb_programs,omitempty"`
	NbStreams      int32  `json:"nb_streams,omitempty"`
	ProbeScore     int32  `json:"probe_score,omitempty"`
	Size           string `json:"size,omitempty"`
	StartTime      string `json:"start_time,omitempty"`
}

type ApiHealthCheckResponse

type ApiHealthCheckResponse struct {
	Commit          string `json:"commit,omitempty"`
	DatabaseDialect string `json:"database_dialect,omitempty"`
	Debug           bool   `json:"debug,omitempty"`
	MaxFileSize     int32  `json:"max_file_size,omitempty"`
	StorageDriver   string `json:"storage_driver,omitempty"`
	Tag             string `json:"tag,omitempty"`
}

type ApiMediasMetadata

type ApiMediasMetadata struct {
	Limit  int32 `json:"limit,omitempty"`
	Offset int32 `json:"offset,omitempty"`
	Total  int32 `json:"total,omitempty"`
}

type ApiUpdateMedia

type ApiUpdateMedia struct {
	Title string `json:"title"`
}

type AttachmentsApiService

type AttachmentsApiService service

func (*AttachmentsApiService) AddMediaAttachment

func (a *AttachmentsApiService) AddMediaAttachment(ctx context.Context, mediaId string, key string, file *os.File) (UtilDataResponse, *http.Response, error)

AttachmentsApiService Add attachment to a media Add attachment to a media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param mediaId Media identifier
  • @param key Attachment unique identifier
  • @param file Attachment file

@return UtilDataResponse

func (*AttachmentsApiService) DeleteMediaAttachment

func (a *AttachmentsApiService) DeleteMediaAttachment(ctx context.Context, mediaId string, key string) (UtilDataResponse, *http.Response, error)

AttachmentsApiService Delete attachment of a media Delete attachment of a media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param mediaId Media identifier
  • @param key Attachment unique identifier

@return UtilDataResponse

func (*AttachmentsApiService) GetMediaAttachments

func (a *AttachmentsApiService) GetMediaAttachments(ctx context.Context, mediaId string) (UtilDataResponse, *http.Response, error)

AttachmentsApiService Get attachments of a media Get attachments of a media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param mediaId Media identifier

@return UtilDataResponse

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 DialectDriver

type DialectDriver struct {
}

type EntMedia

type EntMedia struct {
	// CreatedAt holds the value of the \"created_at\" field.
	CreatedAt string `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph. The values are being populated by the MediaQuery when eager-loading is set.
	Edges *EntMediaEdges `json:"edges,omitempty"`
	// ID of the ent.
	Id string `json:"id,omitempty"`
	// OriginalFilename holds the value of the \"original_filename\" field.
	OriginalFilename string `json:"original_filename,omitempty"`
	// Status holds the value of the \"status\" field.
	Status string `json:"status,omitempty"`
	// Title holds the value of the \"title\" field.
	Title string `json:"title,omitempty"`
	// UpdatedAt holds the value of the \"updated_at\" field.
	UpdatedAt string `json:"updated_at,omitempty"`
}

type EntMediaEdges

type EntMediaEdges struct {
	// MediaFiles holds the value of the media_files edge.
	MediaFiles []EntMediaFile `json:"media_files,omitempty"`
}

type EntMediaFile

type EntMediaFile struct {
	// CreatedAt holds the value of the \"created_at\" field.
	CreatedAt string `json:"created_at,omitempty"`
	// DurationSeconds holds the value of the \"duration_seconds\" field.
	DurationSeconds float32 `json:"duration_seconds,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph. The values are being populated by the MediaFileQuery when eager-loading is set.
	Edges *EntMediaFileEdges `json:"edges,omitempty"`
	// Format holds the value of the \"format\" field.
	Format string `json:"format,omitempty"`
	// Framerate holds the value of the \"framerate\" field.
	Framerate int32 `json:"framerate,omitempty"`
	// ID of the ent.
	Id string `json:"id,omitempty"`
	// MediaType holds the value of the \"media_type\" field.
	MediaType string `json:"media_type,omitempty"`
	// RenditionName holds the value of the \"rendition_name\" field.
	RenditionName string `json:"rendition_name,omitempty"`
	// ResolutionHeight holds the value of the \"resolution_height\" field.
	ResolutionHeight int32 `json:"resolution_height,omitempty"`
	// ResolutionWidth holds the value of the \"resolution_width\" field.
	ResolutionWidth int32 `json:"resolution_width,omitempty"`
	// TargetBandwidth holds the value of the \"target_bandwidth\" field.
	TargetBandwidth int32 `json:"target_bandwidth,omitempty"`
	// UpdatedAt holds the value of the \"updated_at\" field.
	UpdatedAt string `json:"updated_at,omitempty"`
	// VideoBitrate holds the value of the \"video_bitrate\" field.
	VideoBitrate int32 `json:"video_bitrate,omitempty"`
}

type EntMediaFileEdges

type EntMediaFileEdges struct {
	// Media holds the value of the media edge.
	Media *EntMedia `json:"media,omitempty"`
}

type EntVideo

type EntVideo struct {
	CreatedAt string `json:"created_at,omitempty"`
	Id        string `json:"id,omitempty"`
	Status    string `json:"status,omitempty"`
	Title     string `json:"title,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

type GenericSwaggerError

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

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type HealthApiService

type HealthApiService service

func (*HealthApiService) CheckHealth

HealthApiService Check service status Check for the health of the service

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return InlineResponse200

type HttputilsDataResponse

type HttputilsDataResponse struct {
	Code int32        `json:"code,omitempty"`
	Data *interface{} `json:"data,omitempty"`
}

type HttputilsErrorResponse

type HttputilsErrorResponse struct {
	Code    int32  `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type InlineResponse200

type InlineResponse200 struct {
	Data             *ApiHealthCheckResponse `json:"data,omitempty"`
	UtilDataResponse *UtilDataResponse       `json:"util.DataResponse,omitempty"`
}

type InlineResponse2001

type InlineResponse2001 struct {
	Data             []EntMedia         `json:"data,omitempty"`
	Metadata         *ApiMediasMetadata `json:"metadata,omitempty"`
	UtilDataResponse *UtilDataResponse  `json:"util.DataResponse,omitempty"`
}

type InlineResponse2002

type InlineResponse2002 struct {
	Data             *EntMedia         `json:"data,omitempty"`
	UtilDataResponse *UtilDataResponse `json:"util.DataResponse,omitempty"`
}

type InlineResponse2003

type InlineResponse2003 struct {
	Data             *ApiFileFormat    `json:"data,omitempty"`
	UtilDataResponse *UtilDataResponse `json:"util.DataResponse,omitempty"`
}

type InstanceApiService

type InstanceApiService service

func (*InstanceApiService) CheckHealth

InstanceApiService Check service status Check for the health of the service

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return InlineResponse200

type MediasApiGetAllMediasOpts

type MediasApiGetAllMediasOpts struct {
	Limit  optional.Int32
	Offset optional.Int32
}

type MediasApiService

type MediasApiService service

func (*MediasApiService) CreateMedia

MediasApiService Create a media Create a new media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param media Media data

@return InlineResponse2002

func (*MediasApiService) DeleteMedia

MediasApiService Delete a media Delete one media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Media ID

@return UtilDataResponse

func (*MediasApiService) GetAllMedias

func (a *MediasApiService) GetAllMedias(ctx context.Context, localVarOptionals *MediasApiGetAllMediasOpts) (InlineResponse2001, *http.Response, error)

func (*MediasApiService) GetMedia

MediasApiService Get a media Get one media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Media ID

@return InlineResponse2002

func (*MediasApiService) UpdateMedia

MediasApiService Update a media Update an existing media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Media ID
  • @param media Media data

@return InlineResponse2002

func (*MediasApiService) UploadAudio

func (a *MediasApiService) UploadAudio(ctx context.Context, id string, file *os.File) (InlineResponse2003, *http.Response, error)

MediasApiService Upload a audio file Upload a new audio file for a given media ID

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Media identifier
  • @param file Audio file

@return InlineResponse2003

func (*MediasApiService) UploadVideo

func (a *MediasApiService) UploadVideo(ctx context.Context, id string, file *os.File) (InlineResponse2003, *http.Response, error)

MediasApiService Upload a video file Upload a new video file for a given media ID

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Media identifier
  • @param file Video file

@return InlineResponse2003

type StreamApiService

type StreamApiService service

func (*StreamApiService) GetMediaPlaylistFile

func (a *StreamApiService) GetMediaPlaylistFile(ctx context.Context, mediaId string, filename string) (string, *http.Response, error)

StreamApiService Get HLS playlist file of a media Get HLS playlist file of a media

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param mediaId Media identifier
  • @param filename HLS filename

@return string

type UtilDataResponse

type UtilDataResponse struct {
	Code     int32        `json:"code,omitempty"`
	Data     *interface{} `json:"data,omitempty"`
	Metadata *interface{} `json:"metadata,omitempty"`
}

type UtilErrorResponse

type UtilErrorResponse struct {
	Code    int32  `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type VideosApiService

type VideosApiService service

func (*VideosApiService) V1VideosGet

func (a *VideosApiService) V1VideosGet(ctx context.Context, localVarOptionals *VideosApiV1VideosGetOpts) (InlineResponse200, *http.Response, error)

func (*VideosApiService) V1VideosIdDelete

func (a *VideosApiService) V1VideosIdDelete(ctx context.Context, id string) (HttputilsDataResponse, *http.Response, error)

VideosApiService Delete a video Delete one video

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Video ID

@return HttputilsDataResponse

func (*VideosApiService) V1VideosIdGet

VideosApiService Get a video get one video

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Video ID

@return InlineResponse2001

func (*VideosApiService) V1VideosIdPatch

func (a *VideosApiService) V1VideosIdPatch(ctx context.Context, id string, title string) (InlineResponse2001, *http.Response, error)

VideosApiService Update a video Update an existing video

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Video ID
  • @param title Video title

@return InlineResponse2001

func (*VideosApiService) V1VideosIdUploadPost

func (a *VideosApiService) V1VideosIdUploadPost(ctx context.Context, id string, file *os.File) (InlineResponse2001, *http.Response, error)

VideosApiService Upload a video file Upload a new video file for a given video ID

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Video ID
  • @param file Video file

@return InlineResponse2001

func (*VideosApiService) V1VideosPost

func (a *VideosApiService) V1VideosPost(ctx context.Context, title string) (InlineResponse2001, *http.Response, error)

VideosApiService Create a video Create a new video

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param title Video title

@return InlineResponse2001

type VideosApiV1VideosGetOpts

type VideosApiV1VideosGetOpts struct {
	Limit  optional.Int32
	Offset optional.Int32
}

Jump to

Keyboard shortcuts

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