screenshot

package
v0.0.0-...-2cf9753 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package screenshot is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.5.0.

It is generated from these files:

rpc/screenshot/service.proto

Index

Constants

View Source
const ScreenshotPathPrefix = "/twirp/pressly.Screenshot/"

ScreenshotPathPrefix is used for all URL paths on a twirp Screenshot server. Requests are always: POST ScreenshotPathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.

Variables

This section is empty.

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type RequestImage

type RequestImage struct {
	Url                  string   `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	Window               string   `protobuf:"bytes,2,opt,name=window,proto3" json:"window,omitempty"`
	X                    float32  `protobuf:"fixed32,3,opt,name=x,proto3" json:"x,omitempty"`
	Y                    float32  `protobuf:"fixed32,4,opt,name=y,proto3" json:"y,omitempty"`
	Crop                 string   `protobuf:"bytes,5,opt,name=crop,proto3" json:"crop,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RequestImage) Descriptor

func (*RequestImage) Descriptor() ([]byte, []int)

func (*RequestImage) GetCrop

func (m *RequestImage) GetCrop() string

func (*RequestImage) GetUrl

func (m *RequestImage) GetUrl() string

func (*RequestImage) GetWindow

func (m *RequestImage) GetWindow() string

func (*RequestImage) GetX

func (m *RequestImage) GetX() float32

func (*RequestImage) GetY

func (m *RequestImage) GetY() float32

func (*RequestImage) ProtoMessage

func (*RequestImage) ProtoMessage()

func (*RequestImage) Reset

func (m *RequestImage) Reset()

func (*RequestImage) String

func (m *RequestImage) String() string

func (*RequestImage) XXX_DiscardUnknown

func (m *RequestImage) XXX_DiscardUnknown()

func (*RequestImage) XXX_Marshal

func (m *RequestImage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestImage) XXX_Merge

func (m *RequestImage) XXX_Merge(src proto.Message)

func (*RequestImage) XXX_Size

func (m *RequestImage) XXX_Size() int

func (*RequestImage) XXX_Unmarshal

func (m *RequestImage) XXX_Unmarshal(b []byte) error

type Resp

type Resp struct {
	Resp                 []byte   `protobuf:"bytes,1,opt,name=resp,proto3" json:"resp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Resp) Descriptor

func (*Resp) Descriptor() ([]byte, []int)

func (*Resp) GetResp

func (m *Resp) GetResp() []byte

func (*Resp) ProtoMessage

func (*Resp) ProtoMessage()

func (*Resp) Reset

func (m *Resp) Reset()

func (*Resp) String

func (m *Resp) String() string

func (*Resp) XXX_DiscardUnknown

func (m *Resp) XXX_DiscardUnknown()

func (*Resp) XXX_Marshal

func (m *Resp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Resp) XXX_Merge

func (m *Resp) XXX_Merge(src proto.Message)

func (*Resp) XXX_Size

func (m *Resp) XXX_Size() int

func (*Resp) XXX_Unmarshal

func (m *Resp) XXX_Unmarshal(b []byte) error

type Screenshot

type Screenshot interface {
	// Image takes a URL and produces a screenshot of that page.
	Image(context.Context, *RequestImage) (*Resp, error)
}

Screenshot service takes a screenshots of web pages.

func NewScreenshotJSONClient

func NewScreenshotJSONClient(addr string, client HTTPClient) Screenshot

NewScreenshotJSONClient creates a JSON client that implements the Screenshot interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewScreenshotProtobufClient

func NewScreenshotProtobufClient(addr string, client HTTPClient) Screenshot

NewScreenshotProtobufClient creates a Protobuf client that implements the Screenshot interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type TwirpServer

type TwirpServer interface {
	http.Handler
	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)
	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewScreenshotServer

func NewScreenshotServer(svc Screenshot, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

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