platform

package
v0.0.0-...-7a84625 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

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

It is generated from these files:

platform/platform.proto

Index

Constants

View Source
const AuthSvcPathPrefix = "/twirp/com.abpsamtwirp.platform.AuthSvc/"

AuthSvcPathPrefix is used for all URL paths on a twirp AuthSvc server. Requests are always: POST AuthSvcPathPrefix/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 (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type AuthSvc

type AuthSvc interface {
	Token(context.Context, *TokenReq) (*TokenRes, error)
}

Auth service

func NewAuthSvcJSONClient

func NewAuthSvcJSONClient(addr string, client HTTPClient) AuthSvc

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

func NewAuthSvcProtobufClient

func NewAuthSvcProtobufClient(addr string, client HTTPClient) AuthSvc

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

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TODO: use google empty,timestamp,latlng currently TS json client wont allow imports other than validator

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) Validate

func (this *Empty) Validate() error

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) 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 LatLng

type LatLng struct {
	// The latitude in degrees. It must be in the range [-90.0, +90.0].
	Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// The longitude in degrees. It must be in the range [-180.0, +180.0].
	Longitude            float64  `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LatLng) Descriptor

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

func (*LatLng) GetLatitude

func (m *LatLng) GetLatitude() float64

func (*LatLng) GetLongitude

func (m *LatLng) GetLongitude() float64

func (*LatLng) ProtoMessage

func (*LatLng) ProtoMessage()

func (*LatLng) Reset

func (m *LatLng) Reset()

func (*LatLng) String

func (m *LatLng) String() string

func (*LatLng) Validate

func (this *LatLng) Validate() error

func (*LatLng) XXX_DiscardUnknown

func (m *LatLng) XXX_DiscardUnknown()

func (*LatLng) XXX_Marshal

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

func (*LatLng) XXX_Merge

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

func (*LatLng) XXX_Size

func (m *LatLng) XXX_Size() int

func (*LatLng) XXX_Unmarshal

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

type Timestamp

type Timestamp struct {
	// Represents seconds of UTC time since Unix epoch
	// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
	// 9999-12-31T23:59:59Z inclusive.
	Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
	// Non-negative fractions of a second at nanosecond resolution. Negative
	// second values with fractions must still have non-negative nanos values
	// that count forward in time. Must be from 0 to 999,999,999
	// inclusive.
	Nanos                int32    `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Timestamp) Descriptor

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

func (*Timestamp) GetNanos

func (m *Timestamp) GetNanos() int32

func (*Timestamp) GetSeconds

func (m *Timestamp) GetSeconds() int64

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) Reset

func (m *Timestamp) Reset()

func (*Timestamp) String

func (m *Timestamp) String() string

func (*Timestamp) Validate

func (this *Timestamp) Validate() error

func (*Timestamp) XXX_DiscardUnknown

func (m *Timestamp) XXX_DiscardUnknown()

func (*Timestamp) XXX_Marshal

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

func (*Timestamp) XXX_Merge

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

func (*Timestamp) XXX_Size

func (m *Timestamp) XXX_Size() int

func (*Timestamp) XXX_Unmarshal

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

type TokenReq

type TokenReq struct {
	// Send firebase token during intial login (when no platform token exists)
	FirebaseToken        string   `protobuf:"bytes,1,opt,name=firebaseToken,proto3" json:"firebaseToken,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

If firebase token expired, meta 'expired_fbase_token':'true' will be return If platform token expired, meta 'expired_platform_token':'true' will be return If platform or firebase token has no email, 'token_missing_email':'true' will be returned When firebaseToken sent (logging in / creating user) 'customer_delinquent':'true' means delinquent stripe customer

func (*TokenReq) Descriptor

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

func (*TokenReq) GetFirebaseToken

func (m *TokenReq) GetFirebaseToken() string

func (*TokenReq) ProtoMessage

func (*TokenReq) ProtoMessage()

func (*TokenReq) Reset

func (m *TokenReq) Reset()

func (*TokenReq) String

func (m *TokenReq) String() string

func (*TokenReq) Validate

func (this *TokenReq) Validate() error

func (*TokenReq) XXX_DiscardUnknown

func (m *TokenReq) XXX_DiscardUnknown()

func (*TokenReq) XXX_Marshal

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

func (*TokenReq) XXX_Merge

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

func (*TokenReq) XXX_Size

func (m *TokenReq) XXX_Size() int

func (*TokenReq) XXX_Unmarshal

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

type TokenRes

type TokenRes struct {
	Jwt                  string   `protobuf:"bytes,1,opt,name=jwt,proto3" json:"jwt,omitempty"`
	Exp                  int64    `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TokenRes) Descriptor

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

func (*TokenRes) GetExp

func (m *TokenRes) GetExp() int64

func (*TokenRes) GetJwt

func (m *TokenRes) GetJwt() string

func (*TokenRes) ProtoMessage

func (*TokenRes) ProtoMessage()

func (*TokenRes) Reset

func (m *TokenRes) Reset()

func (*TokenRes) String

func (m *TokenRes) String() string

func (*TokenRes) Validate

func (this *TokenRes) Validate() error

func (*TokenRes) XXX_DiscardUnknown

func (m *TokenRes) XXX_DiscardUnknown()

func (*TokenRes) XXX_Marshal

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

func (*TokenRes) XXX_Merge

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

func (*TokenRes) XXX_Size

func (m *TokenRes) XXX_Size() int

func (*TokenRes) XXX_Unmarshal

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

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
	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route twirp requests
	// alongside non-twirp requests on one HTTP listener.
	PathPrefix() 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 NewAuthSvcServer

func NewAuthSvcServer(svc AuthSvc, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

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