Package cloud.google.com/go/video/transcoder/apiv1beta1

Package transcoder is an auto-generated package for the Transcoder API.

This API converts video files into formats suitable for consumer distribution.

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

For information about setting deadlines, reusing contexts, and more please visit pkg.go.dev/cloud.google.com/go.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

CallOptions

type CallOptions struct {
	CreateJob         []gax.CallOption
	ListJobs          []gax.CallOption
	GetJob            []gax.CallOption
	DeleteJob         []gax.CallOption
	CreateJobTemplate []gax.CallOption
	ListJobTemplates  []gax.CallOption
	GetJobTemplate    []gax.CallOption
	DeleteJobTemplate []gax.CallOption
}

CallOptions contains the retry settings for each method of Client.

Client

type Client struct {

	// The call options for this service.
	CallOptions *CallOptions
	// contains filtered or unexported fields
}

Client is a client for interacting with Transcoder API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewClient creates a new transcoder service client.

Using the Transcoder API, you can queue asynchronous jobs for transcoding media into various output formats. Output formats may include different streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can also customize jobs using advanced features such as Digital Rights Management (DRM), audio equalization, content concatenation, and digital ad-stitch ready content generation.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
)

func main() {
	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use client.
	_ = c
}

func (*Client) Close

func (c *Client) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*Client) Connection

func (c *Client) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*Client) CreateJob

func (c *Client) CreateJob(ctx context.Context, req *transcoderpb.CreateJobRequest, opts ...gax.CallOption) (*transcoderpb.Job, error)

CreateJob creates a job in the specified region.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	// import transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"

	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.CreateJobRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) CreateJobTemplate

CreateJobTemplate creates a job template in the specified region.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	// import transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"

	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.CreateJobTemplateRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateJobTemplate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) DeleteJob

func (c *Client) DeleteJob(ctx context.Context, req *transcoderpb.DeleteJobRequest, opts ...gax.CallOption) error

DeleteJob deletes a job.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.DeleteJobRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) DeleteJobTemplate

func (c *Client) DeleteJobTemplate(ctx context.Context, req *transcoderpb.DeleteJobTemplateRequest, opts ...gax.CallOption) error

DeleteJobTemplate deletes a job template.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.DeleteJobTemplateRequest{
		// TODO: Fill request struct fields.
	}
	err = c.DeleteJobTemplate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*Client) GetJob

func (c *Client) GetJob(ctx context.Context, req *transcoderpb.GetJobRequest, opts ...gax.CallOption) (*transcoderpb.Job, error)

GetJob returns the job data.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	// import transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"

	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.GetJobRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetJobTemplate

GetJobTemplate returns the job template data.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	// import transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"

	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.GetJobTemplateRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetJobTemplate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ListJobTemplates

ListJobTemplates lists job templates in the specified region.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	"google.golang.org/api/iterator"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	// import transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.ListJobTemplatesRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListJobTemplates(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListJobs

func (c *Client) ListJobs(ctx context.Context, req *transcoderpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator

ListJobs lists jobs in the specified region.

Example

package main

import (
	transcoder "cloud.google.com/go/video/transcoder/apiv1beta1"
	"context"
	"google.golang.org/api/iterator"
	transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
)

func main() {
	// import transcoderpb "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1beta1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := transcoder.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &transcoderpb.ListJobsRequest{
		// TODO: Fill request struct fields.
	}
	it := c.ListJobs(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

JobIterator

type JobIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*transcoderpb.Job, nextPageToken string, err error)
	// contains filtered or unexported fields
}

JobIterator manages a stream of *transcoderpb.Job.

func (*JobIterator) Next

func (it *JobIterator) Next() (*transcoderpb.Job, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*JobIterator) PageInfo

func (it *JobIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

JobTemplateIterator

type JobTemplateIterator struct {

	// Response is the raw response for the current page.
	// It must be cast to the RPC response type.
	// Calling Next() or InternalFetch() updates this value.
	Response interface{}

	// InternalFetch is for use by the Google Cloud Libraries only.
	// It is not part of the stable interface of this package.
	//
	// InternalFetch returns results from a single call to the underlying RPC.
	// The number of results is no greater than pageSize.
	// If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*transcoderpb.JobTemplate, nextPageToken string, err error)
	// contains filtered or unexported fields
}

JobTemplateIterator manages a stream of *transcoderpb.JobTemplate.

func (*JobTemplateIterator) Next

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*JobTemplateIterator) PageInfo

func (it *JobTemplateIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.