baseplate

package
v0.0.0-...-bde19ca Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseplateServiceIsHealthyResult_Success_DEFAULT bool
View Source
var GoUnusedProtection__ int

Functions

This section is empty.

Types

type AuthenticationToken

type AuthenticationToken string

A raw authentication token as returned by the authentication service.

func AuthenticationTokenPtr

func AuthenticationTokenPtr(v AuthenticationToken) *AuthenticationToken

type BaseplateService

type BaseplateService interface {

	// Return whether or not the service is healthy.
	//
	// The healthchecker (baseplate.server.healthcheck) expects this endpoint to
	// exist so it can determine your service's health.
	//
	// This should return True if the service is healthy. If the service is
	// unhealthy, it can return False or raise an exception.
	//
	IsHealthy(ctx context.Context) (r bool, err error)
}

type BaseplateServiceClient

type BaseplateServiceClient struct {
	// contains filtered or unexported fields
}

The base for any baseplate-based service.

Your service should inherit from this one so that common tools can interact with any expected interfaces.

func NewBaseplateServiceClient

func NewBaseplateServiceClient(c thrift.TClient) *BaseplateServiceClient

func NewBaseplateServiceClientProtocol

func NewBaseplateServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *BaseplateServiceClient

func (*BaseplateServiceClient) Client_

func (p *BaseplateServiceClient) Client_() thrift.TClient

func (*BaseplateServiceClient) IsHealthy

func (p *BaseplateServiceClient) IsHealthy(ctx context.Context) (r bool, err error)

Return whether or not the service is healthy.

The healthchecker (baseplate.server.healthcheck) expects this endpoint to exist so it can determine your service's health.

This should return True if the service is healthy. If the service is unhealthy, it can return False or raise an exception.

type BaseplateServiceIsHealthyArgs

type BaseplateServiceIsHealthyArgs struct {
}

func NewBaseplateServiceIsHealthyArgs

func NewBaseplateServiceIsHealthyArgs() *BaseplateServiceIsHealthyArgs

func (*BaseplateServiceIsHealthyArgs) Read

func (*BaseplateServiceIsHealthyArgs) String

func (*BaseplateServiceIsHealthyArgs) Write

type BaseplateServiceIsHealthyResult

type BaseplateServiceIsHealthyResult struct {
	Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
}

Attributes:

  • Success

func NewBaseplateServiceIsHealthyResult

func NewBaseplateServiceIsHealthyResult() *BaseplateServiceIsHealthyResult

func (*BaseplateServiceIsHealthyResult) GetSuccess

func (p *BaseplateServiceIsHealthyResult) GetSuccess() bool

func (*BaseplateServiceIsHealthyResult) IsSetSuccess

func (p *BaseplateServiceIsHealthyResult) IsSetSuccess() bool

func (*BaseplateServiceIsHealthyResult) Read

func (*BaseplateServiceIsHealthyResult) ReadField0

func (*BaseplateServiceIsHealthyResult) String

func (*BaseplateServiceIsHealthyResult) Write

type BaseplateServiceProcessor

type BaseplateServiceProcessor struct {
	// contains filtered or unexported fields
}

func NewBaseplateServiceProcessor

func NewBaseplateServiceProcessor(handler BaseplateService) *BaseplateServiceProcessor

func (*BaseplateServiceProcessor) AddToProcessorMap

func (p *BaseplateServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)

func (*BaseplateServiceProcessor) GetProcessorFunction

func (p *BaseplateServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)

func (*BaseplateServiceProcessor) Process

func (p *BaseplateServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)

func (*BaseplateServiceProcessor) ProcessorMap

type Device

type Device struct {
	ID string `thrift:"id,1" db:"id" json:"id"`
}

The components of the device making a request to our services that we want to propogate between services.

This model is a component of the "Edge-Request" header. You should not need to interact with this model directly, but rather through the EdgeRequestContext interface provided by baseplate.

Attributes:

  • ID: The ID of the device.
var Request_Device_DEFAULT *Device

func NewDevice

func NewDevice() *Device

func (*Device) GetID

func (p *Device) GetID() string

func (*Device) Read

func (p *Device) Read(iprot thrift.TProtocol) error

func (*Device) ReadField1

func (p *Device) ReadField1(iprot thrift.TProtocol) error

func (*Device) String

func (p *Device) String() string

func (*Device) Write

func (p *Device) Write(oprot thrift.TProtocol) error

type Loid

type Loid struct {
	ID        string `thrift:"id,1" db:"id" json:"id"`
	CreatedMs int64  `thrift:"created_ms,2" db:"created_ms" json:"created_ms"`
}

The components of the Reddit LoID cookie that we want to propogate between services.

This model is a component of the "Edge-Request" header. You should not need to interact with this model directly, but rather through the EdgeRequestContext interface provided by baseplate.

Attributes:

  • ID: The ID of the LoID cookie.

  • CreatedMs: The time when the LoID cookie was created in epoch milliseconds.

var Request_Loid_DEFAULT *Loid

func NewLoid

func NewLoid() *Loid

func (*Loid) GetCreatedMs

func (p *Loid) GetCreatedMs() int64

func (*Loid) GetID

func (p *Loid) GetID() string

func (*Loid) Read

func (p *Loid) Read(iprot thrift.TProtocol) error

func (*Loid) ReadField1

func (p *Loid) ReadField1(iprot thrift.TProtocol) error

func (*Loid) ReadField2

func (p *Loid) ReadField2(iprot thrift.TProtocol) error

func (*Loid) String

func (p *Loid) String() string

func (*Loid) Write

func (p *Loid) Write(oprot thrift.TProtocol) error

type Request

type Request struct {
	Loid                *Loid               `thrift:"loid,1" db:"loid" json:"loid"`
	Session             *Session            `thrift:"session,2" db:"session" json:"session"`
	AuthenticationToken AuthenticationToken `thrift:"authentication_token,3" db:"authentication_token" json:"authentication_token"`
	Device              *Device             `thrift:"device,4" db:"device" json:"device"`
}

Container model for the Edge-Request context header.

Baseplate will automatically parse this from the "Edge-Request" header and provides an interface that wraps this Thrift model. You should not need to interact with this model directly, but rather through the EdgeRequestContext interface provided by baseplate.

Attributes:

  • Loid
  • Session
  • AuthenticationToken
  • Device

func NewRequest

func NewRequest() *Request

func (*Request) GetAuthenticationToken

func (p *Request) GetAuthenticationToken() AuthenticationToken

func (*Request) GetDevice

func (p *Request) GetDevice() *Device

func (*Request) GetLoid

func (p *Request) GetLoid() *Loid

func (*Request) GetSession

func (p *Request) GetSession() *Session

func (*Request) IsSetDevice

func (p *Request) IsSetDevice() bool

func (*Request) IsSetLoid

func (p *Request) IsSetLoid() bool

func (*Request) IsSetSession

func (p *Request) IsSetSession() bool

func (*Request) Read

func (p *Request) Read(iprot thrift.TProtocol) error

func (*Request) ReadField1

func (p *Request) ReadField1(iprot thrift.TProtocol) error

func (*Request) ReadField2

func (p *Request) ReadField2(iprot thrift.TProtocol) error

func (*Request) ReadField3

func (p *Request) ReadField3(iprot thrift.TProtocol) error

func (*Request) ReadField4

func (p *Request) ReadField4(iprot thrift.TProtocol) error

func (*Request) String

func (p *Request) String() string

func (*Request) Write

func (p *Request) Write(oprot thrift.TProtocol) error

type Session

type Session struct {
	ID string `thrift:"id,1" db:"id" json:"id"`
}

The components of the Reddit Session tracker cookie that we want to propogate between services.

This model is a component of the "Edge-Request" header. You should not need to interact with this model directly, but rather through the EdgeRequestContext interface provided by baseplate.

Attributes:

  • ID: The ID of the Session tracker cookie.
var Request_Session_DEFAULT *Session

func NewSession

func NewSession() *Session

func (*Session) GetID

func (p *Session) GetID() string

func (*Session) Read

func (p *Session) Read(iprot thrift.TProtocol) error

func (*Session) ReadField1

func (p *Session) ReadField1(iprot thrift.TProtocol) error

func (*Session) String

func (p *Session) String() string

func (*Session) Write

func (p *Session) Write(oprot thrift.TProtocol) error

Jump to

Keyboard shortcuts

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