Documentation
¶
Index ¶
- type Config
- type ConfigOutput
- type IProxy
- type ITailer
- type RPCService
- func (srv *RPCService) EventsResend(ctx context.Context, req *rpc.EventsResendRequest) (*rpc.EventsResendResponse, error)
- func (srv *RPCService) Fixture(ctx context.Context, req *rpc.FixtureRequest) (*rpc.FixtureResponse, error)
- func (srv *RPCService) Listen(req *rpc.ListenRequest, stream rpc.StripeCLI_ListenServer) error
- func (srv *RPCService) Login(ctx context.Context, req *rpc.LoginRequest) (*rpc.LoginResponse, error)
- func (srv *RPCService) LoginStatus(ctx context.Context, req *rpc.LoginStatusRequest) (*rpc.LoginStatusResponse, error)
- func (srv *RPCService) LogsTail(req *rpc.LogsTailRequest, stream rpc.StripeCLI_LogsTailServer) error
- func (srv *RPCService) Run(ctx context.Context)
- func (srv *RPCService) SampleConfigs(ctx context.Context, req *rpc.SampleConfigsRequest) (*rpc.SampleConfigsResponse, error)
- func (srv *RPCService) SampleCreate(ctx context.Context, req *rpc.SampleCreateRequest) (*rpc.SampleCreateResponse, error)
- func (srv *RPCService) SamplesList(ctx context.Context, req *rpc.SamplesListRequest) (*rpc.SamplesListResponse, error)
- func (srv *RPCService) Trigger(ctx context.Context, req *rpc.TriggerRequest) (*rpc.TriggerResponse, error)
- func (srv *RPCService) TriggersList(ctx context.Context, req *rpc.TriggersListRequest) (*rpc.TriggersListResponse, error)
- func (srv *RPCService) Version(ctx context.Context, req *rpc.VersionRequest) (*rpc.VersionResponse, error)
- func (srv *RPCService) WebhookEndpointCreate(ctx context.Context, req *rpc.WebhookEndpointCreateRequest) (*rpc.WebhookEndpointCreateResponse, error)
- func (srv *RPCService) WebhookEndpointsList(ctx context.Context, req *rpc.WebhookEndpointsListRequest) (*rpc.WebhookEndpointsListResponse, error)
- type WrappedServerStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Port is the port number to listen to on localhost Port int // Info, error, etc. logger. Unrelated to API request logs. Log *log.Logger // UserCfg is the Stripe CLI config of the user UserCfg *config.Config }
Config provides the configuration for the RPC service.
type ConfigOutput ¶
type ConfigOutput struct { // Host is the IP address of the gRPC server Host string `json:"host"` // Port is port number of the gRPC server Port int `json:"port"` }
ConfigOutput is the config that clients will need to connect to the gRPC server. This is printed out for clients to parse.
type RPCService ¶
type RPCService struct { // TelemetryClient to use for sending telemetry events TelemetryClient stripe.TelemetryClient // contains filtered or unexported fields }
RPCService implements the gRPC interface and starts the gRPC server.
func New ¶
func New( cfg *Config, telemetryClient stripe.TelemetryClient, ) *RPCService
New creates a new RPC service
func (*RPCService) EventsResend ¶
func (srv *RPCService) EventsResend(ctx context.Context, req *rpc.EventsResendRequest) (*rpc.EventsResendResponse, error)
EventsResend resends an event given an event ID
func (*RPCService) Fixture ¶ added in v1.7.5
func (srv *RPCService) Fixture(ctx context.Context, req *rpc.FixtureRequest) (*rpc.FixtureResponse, error)
Fixture returns the default fixture of given event in string format
func (*RPCService) Listen ¶
func (srv *RPCService) Listen(req *rpc.ListenRequest, stream rpc.StripeCLI_ListenServer) error
Listen returns a stream of webhook events and forwards them to a local endpoint
func (*RPCService) Login ¶
func (srv *RPCService) Login(ctx context.Context, req *rpc.LoginRequest) (*rpc.LoginResponse, error)
Login returns a URL and pairing code to complete the login for the Stripe CLI
func (*RPCService) LoginStatus ¶
func (srv *RPCService) LoginStatus(ctx context.Context, req *rpc.LoginStatusRequest) (*rpc.LoginStatusResponse, error)
LoginStatus returns when login is successful, or returns an error if failure or timeout.
func (*RPCService) LogsTail ¶
func (srv *RPCService) LogsTail(req *rpc.LogsTailRequest, stream rpc.StripeCLI_LogsTailServer) error
LogsTail returns a stream of API logs
func (*RPCService) Run ¶
func (srv *RPCService) Run(ctx context.Context)
Run starts a gRPC server on localhost
func (*RPCService) SampleConfigs ¶
func (srv *RPCService) SampleConfigs(ctx context.Context, req *rpc.SampleConfigsRequest) (*rpc.SampleConfigsResponse, error)
SampleConfigs returns a list of available configs for a given Stripe sample.
func (*RPCService) SampleCreate ¶
func (srv *RPCService) SampleCreate(ctx context.Context, req *rpc.SampleCreateRequest) (*rpc.SampleCreateResponse, error)
SampleCreate creates a sample at a given path with the selected integration, client language, and server language.
func (*RPCService) SamplesList ¶
func (srv *RPCService) SamplesList(ctx context.Context, req *rpc.SamplesListRequest) (*rpc.SamplesListResponse, error)
SamplesList returns a list of available Stripe samples
func (*RPCService) Trigger ¶
func (srv *RPCService) Trigger(ctx context.Context, req *rpc.TriggerRequest) (*rpc.TriggerResponse, error)
Trigger triggers a Stripe event.
func (*RPCService) TriggersList ¶
func (srv *RPCService) TriggersList(ctx context.Context, req *rpc.TriggersListRequest) (*rpc.TriggersListResponse, error)
TriggersList returns a list of available events for `Trigger`.
func (*RPCService) Version ¶
func (srv *RPCService) Version(ctx context.Context, req *rpc.VersionRequest) (*rpc.VersionResponse, error)
Version returns the version of the Stripe CLI
func (*RPCService) WebhookEndpointCreate ¶ added in v1.7.12
func (srv *RPCService) WebhookEndpointCreate(ctx context.Context, req *rpc.WebhookEndpointCreateRequest) (*rpc.WebhookEndpointCreateResponse, error)
WebhookEndpointCreate create a new webhook endpoint
func (*RPCService) WebhookEndpointsList ¶ added in v1.7.9
func (srv *RPCService) WebhookEndpointsList(ctx context.Context, req *rpc.WebhookEndpointsListRequest) (*rpc.WebhookEndpointsListResponse, error)
WebhookEndpointsList returns a list of webhook endpoints.
type WrappedServerStream ¶ added in v1.7.4
type WrappedServerStream struct { grpc.ServerStream // contains filtered or unexported fields }
WrappedServerStream wraps a ServerSteam so that we can pass values through context. https://pkgo.dev/github.com/grpc-ecosystem/go-grpc-middleware#hdr-Writing_Your_Own
func (WrappedServerStream) Context ¶ added in v1.7.4
func (w WrappedServerStream) Context() context.Context
Context returns the context for this stream.