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
- func WriteError(resp http.ResponseWriter, err error)
- type AuthSvc
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (this *Empty) Validate() error
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type HTTPClient
- type LatLng
- func (*LatLng) Descriptor() ([]byte, []int)
- func (m *LatLng) GetLatitude() float64
- func (m *LatLng) GetLongitude() float64
- func (*LatLng) ProtoMessage()
- func (m *LatLng) Reset()
- func (m *LatLng) String() string
- func (this *LatLng) Validate() error
- func (m *LatLng) XXX_DiscardUnknown()
- func (m *LatLng) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LatLng) XXX_Merge(src proto.Message)
- func (m *LatLng) XXX_Size() int
- func (m *LatLng) XXX_Unmarshal(b []byte) error
- type Timestamp
- func (*Timestamp) Descriptor() ([]byte, []int)
- func (m *Timestamp) GetNanos() int32
- func (m *Timestamp) GetSeconds() int64
- func (*Timestamp) ProtoMessage()
- func (m *Timestamp) Reset()
- func (m *Timestamp) String() string
- func (this *Timestamp) Validate() error
- func (m *Timestamp) XXX_DiscardUnknown()
- func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Timestamp) XXX_Merge(src proto.Message)
- func (m *Timestamp) XXX_Size() int
- func (m *Timestamp) XXX_Unmarshal(b []byte) error
- type TokenReq
- func (*TokenReq) Descriptor() ([]byte, []int)
- func (m *TokenReq) GetFirebaseToken() string
- func (*TokenReq) ProtoMessage()
- func (m *TokenReq) Reset()
- func (m *TokenReq) String() string
- func (this *TokenReq) Validate() error
- func (m *TokenReq) XXX_DiscardUnknown()
- func (m *TokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TokenReq) XXX_Merge(src proto.Message)
- func (m *TokenReq) XXX_Size() int
- func (m *TokenReq) XXX_Unmarshal(b []byte) error
- type TokenRes
- func (*TokenRes) Descriptor() ([]byte, []int)
- func (m *TokenRes) GetExp() int64
- func (m *TokenRes) GetJwt() string
- func (*TokenRes) ProtoMessage()
- func (m *TokenRes) Reset()
- func (m *TokenRes) String() string
- func (this *TokenRes) Validate() error
- func (m *TokenRes) XXX_DiscardUnknown()
- func (m *TokenRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TokenRes) XXX_Merge(src proto.Message)
- func (m *TokenRes) XXX_Size() int
- func (m *TokenRes) XXX_Unmarshal(b []byte) error
- type TwirpServer
Constants ¶
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 ¶
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) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type HTTPClient ¶
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) GetLatitude ¶
func (*LatLng) GetLongitude ¶
func (*LatLng) ProtoMessage ¶
func (*LatLng) ProtoMessage()
func (*LatLng) XXX_DiscardUnknown ¶
func (m *LatLng) XXX_DiscardUnknown()
func (*LatLng) XXX_Marshal ¶
func (*LatLng) XXX_Unmarshal ¶
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) GetSeconds ¶
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
func (*Timestamp) XXX_DiscardUnknown ¶
func (m *Timestamp) XXX_DiscardUnknown()
func (*Timestamp) XXX_Marshal ¶
func (*Timestamp) XXX_Unmarshal ¶
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) GetFirebaseToken ¶
func (*TokenReq) ProtoMessage ¶
func (*TokenReq) ProtoMessage()
func (*TokenReq) XXX_DiscardUnknown ¶
func (m *TokenReq) XXX_DiscardUnknown()
func (*TokenReq) XXX_Marshal ¶
func (*TokenReq) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*TokenRes) ProtoMessage()
func (*TokenRes) XXX_DiscardUnknown ¶
func (m *TokenRes) XXX_DiscardUnknown()
func (*TokenRes) XXX_Marshal ¶
func (*TokenRes) XXX_Unmarshal ¶
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