api

package
v0.0.0-...-f5e2105 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package api 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:

github.com/alanchchen/go-example-twirp/api/petstore.proto

Index

Constants

View Source
const PetstoreServicePathPrefix = "/twirp/am.is.PetstoreService/"

PetstoreServicePathPrefix is used for all URL paths on a twirp PetstoreService server. Requests are always: POST PetstoreServicePathPrefix/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 RegisterPetstoreServiceServer

func RegisterPetstoreServiceServer(s *grpc.Server, srv PetstoreServiceServer)

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 AddPetRequest

type AddPetRequest struct {
	// Pet to add to the store
	Pet                  *AddPetRequest_PetMessage `protobuf:"bytes,1,opt,name=pet,proto3" json:"pet,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
	XXX_unrecognized     []byte                    `json:"-"`
	XXX_sizecache        int32                     `json:"-"`
}

func (*AddPetRequest) Descriptor

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

func (*AddPetRequest) GetPet

func (*AddPetRequest) ProtoMessage

func (*AddPetRequest) ProtoMessage()

func (*AddPetRequest) Reset

func (m *AddPetRequest) Reset()

func (*AddPetRequest) String

func (m *AddPetRequest) String() string

func (*AddPetRequest) XXX_DiscardUnknown

func (m *AddPetRequest) XXX_DiscardUnknown()

func (*AddPetRequest) XXX_Marshal

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

func (*AddPetRequest) XXX_Merge

func (dst *AddPetRequest) XXX_Merge(src proto.Message)

func (*AddPetRequest) XXX_Size

func (m *AddPetRequest) XXX_Size() int

func (*AddPetRequest) XXX_Unmarshal

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

type AddPetRequest_PetMessage

type AddPetRequest_PetMessage struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Tag                  string   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddPetRequest_PetMessage) Descriptor

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

func (*AddPetRequest_PetMessage) GetId

func (m *AddPetRequest_PetMessage) GetId() int64

func (*AddPetRequest_PetMessage) GetName

func (m *AddPetRequest_PetMessage) GetName() string

func (*AddPetRequest_PetMessage) GetTag

func (m *AddPetRequest_PetMessage) GetTag() string

func (*AddPetRequest_PetMessage) ProtoMessage

func (*AddPetRequest_PetMessage) ProtoMessage()

func (*AddPetRequest_PetMessage) Reset

func (m *AddPetRequest_PetMessage) Reset()

func (*AddPetRequest_PetMessage) String

func (m *AddPetRequest_PetMessage) String() string

func (*AddPetRequest_PetMessage) XXX_DiscardUnknown

func (m *AddPetRequest_PetMessage) XXX_DiscardUnknown()

func (*AddPetRequest_PetMessage) XXX_Marshal

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

func (*AddPetRequest_PetMessage) XXX_Merge

func (dst *AddPetRequest_PetMessage) XXX_Merge(src proto.Message)

func (*AddPetRequest_PetMessage) XXX_Size

func (m *AddPetRequest_PetMessage) XXX_Size() int

func (*AddPetRequest_PetMessage) XXX_Unmarshal

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

type AddPetResponse

type AddPetResponse struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Tag                  string   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddPetResponse) Descriptor

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

func (*AddPetResponse) GetId

func (m *AddPetResponse) GetId() int64

func (*AddPetResponse) GetName

func (m *AddPetResponse) GetName() string

func (*AddPetResponse) GetTag

func (m *AddPetResponse) GetTag() string

func (*AddPetResponse) ProtoMessage

func (*AddPetResponse) ProtoMessage()

func (*AddPetResponse) Reset

func (m *AddPetResponse) Reset()

func (*AddPetResponse) String

func (m *AddPetResponse) String() string

func (*AddPetResponse) XXX_DiscardUnknown

func (m *AddPetResponse) XXX_DiscardUnknown()

func (*AddPetResponse) XXX_Marshal

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

func (*AddPetResponse) XXX_Merge

func (dst *AddPetResponse) XXX_Merge(src proto.Message)

func (*AddPetResponse) XXX_Size

func (m *AddPetResponse) XXX_Size() int

func (*AddPetResponse) XXX_Unmarshal

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

type DeletePetRequest

type DeletePetRequest struct {
	// ID of pet to delete
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeletePetRequest) Descriptor

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

func (*DeletePetRequest) GetId

func (m *DeletePetRequest) GetId() int64

func (*DeletePetRequest) ProtoMessage

func (*DeletePetRequest) ProtoMessage()

func (*DeletePetRequest) Reset

func (m *DeletePetRequest) Reset()

func (*DeletePetRequest) String

func (m *DeletePetRequest) String() string

func (*DeletePetRequest) XXX_DiscardUnknown

func (m *DeletePetRequest) XXX_DiscardUnknown()

func (*DeletePetRequest) XXX_Marshal

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

func (*DeletePetRequest) XXX_Merge

func (dst *DeletePetRequest) XXX_Merge(src proto.Message)

func (*DeletePetRequest) XXX_Size

func (m *DeletePetRequest) XXX_Size() int

func (*DeletePetRequest) XXX_Unmarshal

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

type FindPetByIdRequest

type FindPetByIdRequest struct {
	// ID of pet to fetch
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FindPetByIdRequest) Descriptor

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

func (*FindPetByIdRequest) GetId

func (m *FindPetByIdRequest) GetId() int64

func (*FindPetByIdRequest) ProtoMessage

func (*FindPetByIdRequest) ProtoMessage()

func (*FindPetByIdRequest) Reset

func (m *FindPetByIdRequest) Reset()

func (*FindPetByIdRequest) String

func (m *FindPetByIdRequest) String() string

func (*FindPetByIdRequest) XXX_DiscardUnknown

func (m *FindPetByIdRequest) XXX_DiscardUnknown()

func (*FindPetByIdRequest) XXX_Marshal

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

func (*FindPetByIdRequest) XXX_Merge

func (dst *FindPetByIdRequest) XXX_Merge(src proto.Message)

func (*FindPetByIdRequest) XXX_Size

func (m *FindPetByIdRequest) XXX_Size() int

func (*FindPetByIdRequest) XXX_Unmarshal

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

type FindPetByIdResponse

type FindPetByIdResponse struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Tag                  string   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FindPetByIdResponse) Descriptor

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

func (*FindPetByIdResponse) GetId

func (m *FindPetByIdResponse) GetId() int64

func (*FindPetByIdResponse) GetName

func (m *FindPetByIdResponse) GetName() string

func (*FindPetByIdResponse) GetTag

func (m *FindPetByIdResponse) GetTag() string

func (*FindPetByIdResponse) ProtoMessage

func (*FindPetByIdResponse) ProtoMessage()

func (*FindPetByIdResponse) Reset

func (m *FindPetByIdResponse) Reset()

func (*FindPetByIdResponse) String

func (m *FindPetByIdResponse) String() string

func (*FindPetByIdResponse) XXX_DiscardUnknown

func (m *FindPetByIdResponse) XXX_DiscardUnknown()

func (*FindPetByIdResponse) XXX_Marshal

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

func (*FindPetByIdResponse) XXX_Merge

func (dst *FindPetByIdResponse) XXX_Merge(src proto.Message)

func (*FindPetByIdResponse) XXX_Size

func (m *FindPetByIdResponse) XXX_Size() int

func (*FindPetByIdResponse) XXX_Unmarshal

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

type FindPetsByIdsRequest

type FindPetsByIdsRequest struct {
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// maximum number of results to return
	Limit                int32    `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FindPetsByIdsRequest) Descriptor

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

func (*FindPetsByIdsRequest) GetIds

func (m *FindPetsByIdsRequest) GetIds() []string

func (*FindPetsByIdsRequest) GetLimit

func (m *FindPetsByIdsRequest) GetLimit() int32

func (*FindPetsByIdsRequest) ProtoMessage

func (*FindPetsByIdsRequest) ProtoMessage()

func (*FindPetsByIdsRequest) Reset

func (m *FindPetsByIdsRequest) Reset()

func (*FindPetsByIdsRequest) String

func (m *FindPetsByIdsRequest) String() string

func (*FindPetsByIdsRequest) XXX_DiscardUnknown

func (m *FindPetsByIdsRequest) XXX_DiscardUnknown()

func (*FindPetsByIdsRequest) XXX_Marshal

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

func (*FindPetsByIdsRequest) XXX_Merge

func (dst *FindPetsByIdsRequest) XXX_Merge(src proto.Message)

func (*FindPetsByIdsRequest) XXX_Size

func (m *FindPetsByIdsRequest) XXX_Size() int

func (*FindPetsByIdsRequest) XXX_Unmarshal

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

type FindPetsByIdsResponse

type FindPetsByIdsResponse struct {
	Pets                 []*FindPetsByIdsResponse_PetsMessage `protobuf:"bytes,1,rep,name=pets,proto3" json:"pets,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                             `json:"-"`
	XXX_unrecognized     []byte                               `json:"-"`
	XXX_sizecache        int32                                `json:"-"`
}

func (*FindPetsByIdsResponse) Descriptor

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

func (*FindPetsByIdsResponse) GetPets

func (*FindPetsByIdsResponse) ProtoMessage

func (*FindPetsByIdsResponse) ProtoMessage()

func (*FindPetsByIdsResponse) Reset

func (m *FindPetsByIdsResponse) Reset()

func (*FindPetsByIdsResponse) String

func (m *FindPetsByIdsResponse) String() string

func (*FindPetsByIdsResponse) XXX_DiscardUnknown

func (m *FindPetsByIdsResponse) XXX_DiscardUnknown()

func (*FindPetsByIdsResponse) XXX_Marshal

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

func (*FindPetsByIdsResponse) XXX_Merge

func (dst *FindPetsByIdsResponse) XXX_Merge(src proto.Message)

func (*FindPetsByIdsResponse) XXX_Size

func (m *FindPetsByIdsResponse) XXX_Size() int

func (*FindPetsByIdsResponse) XXX_Unmarshal

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

type FindPetsByIdsResponse_PetsMessage

type FindPetsByIdsResponse_PetsMessage struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Tag                  string   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FindPetsByIdsResponse_PetsMessage) Descriptor

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

func (*FindPetsByIdsResponse_PetsMessage) GetId

func (*FindPetsByIdsResponse_PetsMessage) GetName

func (*FindPetsByIdsResponse_PetsMessage) GetTag

func (*FindPetsByIdsResponse_PetsMessage) ProtoMessage

func (*FindPetsByIdsResponse_PetsMessage) ProtoMessage()

func (*FindPetsByIdsResponse_PetsMessage) Reset

func (*FindPetsByIdsResponse_PetsMessage) String

func (*FindPetsByIdsResponse_PetsMessage) XXX_DiscardUnknown

func (m *FindPetsByIdsResponse_PetsMessage) XXX_DiscardUnknown()

func (*FindPetsByIdsResponse_PetsMessage) XXX_Marshal

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

func (*FindPetsByIdsResponse_PetsMessage) XXX_Merge

func (dst *FindPetsByIdsResponse_PetsMessage) XXX_Merge(src proto.Message)

func (*FindPetsByIdsResponse_PetsMessage) XXX_Size

func (m *FindPetsByIdsResponse_PetsMessage) XXX_Size() int

func (*FindPetsByIdsResponse_PetsMessage) XXX_Unmarshal

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

type FindPetsRequest

type FindPetsRequest struct {
	// maximum number of results to return
	Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	// tags to filter by
	Tags                 []string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FindPetsRequest) Descriptor

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

func (*FindPetsRequest) GetLimit

func (m *FindPetsRequest) GetLimit() int32

func (*FindPetsRequest) GetTags

func (m *FindPetsRequest) GetTags() []string

func (*FindPetsRequest) ProtoMessage

func (*FindPetsRequest) ProtoMessage()

func (*FindPetsRequest) Reset

func (m *FindPetsRequest) Reset()

func (*FindPetsRequest) String

func (m *FindPetsRequest) String() string

func (*FindPetsRequest) XXX_DiscardUnknown

func (m *FindPetsRequest) XXX_DiscardUnknown()

func (*FindPetsRequest) XXX_Marshal

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

func (*FindPetsRequest) XXX_Merge

func (dst *FindPetsRequest) XXX_Merge(src proto.Message)

func (*FindPetsRequest) XXX_Size

func (m *FindPetsRequest) XXX_Size() int

func (*FindPetsRequest) XXX_Unmarshal

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

type FindPetsResponse

type FindPetsResponse struct {
	Pets                 []*FindPetsResponse_PetsMessage `protobuf:"bytes,1,rep,name=pets,proto3" json:"pets,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                        `json:"-"`
	XXX_unrecognized     []byte                          `json:"-"`
	XXX_sizecache        int32                           `json:"-"`
}

func (*FindPetsResponse) Descriptor

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

func (*FindPetsResponse) GetPets

func (*FindPetsResponse) ProtoMessage

func (*FindPetsResponse) ProtoMessage()

func (*FindPetsResponse) Reset

func (m *FindPetsResponse) Reset()

func (*FindPetsResponse) String

func (m *FindPetsResponse) String() string

func (*FindPetsResponse) XXX_DiscardUnknown

func (m *FindPetsResponse) XXX_DiscardUnknown()

func (*FindPetsResponse) XXX_Marshal

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

func (*FindPetsResponse) XXX_Merge

func (dst *FindPetsResponse) XXX_Merge(src proto.Message)

func (*FindPetsResponse) XXX_Size

func (m *FindPetsResponse) XXX_Size() int

func (*FindPetsResponse) XXX_Unmarshal

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

type FindPetsResponse_PetsMessage

type FindPetsResponse_PetsMessage struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Tag                  string   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FindPetsResponse_PetsMessage) Descriptor

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

func (*FindPetsResponse_PetsMessage) GetId

func (*FindPetsResponse_PetsMessage) GetName

func (m *FindPetsResponse_PetsMessage) GetName() string

func (*FindPetsResponse_PetsMessage) GetTag

func (*FindPetsResponse_PetsMessage) ProtoMessage

func (*FindPetsResponse_PetsMessage) ProtoMessage()

func (*FindPetsResponse_PetsMessage) Reset

func (m *FindPetsResponse_PetsMessage) Reset()

func (*FindPetsResponse_PetsMessage) String

func (*FindPetsResponse_PetsMessage) XXX_DiscardUnknown

func (m *FindPetsResponse_PetsMessage) XXX_DiscardUnknown()

func (*FindPetsResponse_PetsMessage) XXX_Marshal

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

func (*FindPetsResponse_PetsMessage) XXX_Merge

func (dst *FindPetsResponse_PetsMessage) XXX_Merge(src proto.Message)

func (*FindPetsResponse_PetsMessage) XXX_Size

func (m *FindPetsResponse_PetsMessage) XXX_Size() int

func (*FindPetsResponse_PetsMessage) XXX_Unmarshal

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

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 PetstoreService

type PetstoreService interface {
	// Creates a new pet in the store.  Duplicates are allowed
	AddPet(context.Context, *AddPetRequest) (*AddPetResponse, error)

	// deletes a single pet based on the ID supplied
	DeletePet(context.Context, *DeletePetRequest) (*google_protobuf1.Empty, error)

	// Returns a user based on a single ID, if the user does not have access to the pet
	FindPetById(context.Context, *FindPetByIdRequest) (*FindPetByIdResponse, error)

	// Returns all pets from the system that the user has access to
	FindPets(context.Context, *FindPetsRequest) (*FindPetsResponse, error)

	// Returns all pets from the system that the user has access to
	FindPetsByIds(context.Context, *FindPetsByIdsRequest) (*FindPetsByIdsResponse, error)
}

func NewPetstoreServiceJSONClient

func NewPetstoreServiceJSONClient(addr string, client HTTPClient) PetstoreService

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

func NewPetstoreServiceProtobufClient

func NewPetstoreServiceProtobufClient(addr string, client HTTPClient) PetstoreService

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

type PetstoreServiceClient

type PetstoreServiceClient interface {
	// Creates a new pet in the store.  Duplicates are allowed
	AddPet(ctx context.Context, in *AddPetRequest, opts ...grpc.CallOption) (*AddPetResponse, error)
	// deletes a single pet based on the ID supplied
	DeletePet(ctx context.Context, in *DeletePetRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Returns a user based on a single ID, if the user does not have access to the pet
	FindPetById(ctx context.Context, in *FindPetByIdRequest, opts ...grpc.CallOption) (*FindPetByIdResponse, error)
	// Returns all pets from the system that the user has access to
	FindPets(ctx context.Context, in *FindPetsRequest, opts ...grpc.CallOption) (*FindPetsResponse, error)
	// Returns all pets from the system that the user has access to
	FindPetsByIds(ctx context.Context, in *FindPetsByIdsRequest, opts ...grpc.CallOption) (*FindPetsByIdsResponse, error)
}

PetstoreServiceClient is the client API for PetstoreService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPetstoreServiceClient

func NewPetstoreServiceClient(cc *grpc.ClientConn) PetstoreServiceClient

type PetstoreServiceServer

type PetstoreServiceServer interface {
	// Creates a new pet in the store.  Duplicates are allowed
	AddPet(context.Context, *AddPetRequest) (*AddPetResponse, error)
	// deletes a single pet based on the ID supplied
	DeletePet(context.Context, *DeletePetRequest) (*empty.Empty, error)
	// Returns a user based on a single ID, if the user does not have access to the pet
	FindPetById(context.Context, *FindPetByIdRequest) (*FindPetByIdResponse, error)
	// Returns all pets from the system that the user has access to
	FindPets(context.Context, *FindPetsRequest) (*FindPetsResponse, error)
	// Returns all pets from the system that the user has access to
	FindPetsByIds(context.Context, *FindPetsByIdsRequest) (*FindPetsByIdsResponse, error)
}

PetstoreServiceServer is the server API for PetstoreService service.

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 NewPetstoreServiceServer

func NewPetstoreServiceServer(svc PetstoreService, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

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