http

package
v0.0.0-...-352bf0c Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Description: This file exposes the public HTTP service for origin.

Description: This file exposes the private HTTP service for origin

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler returns the main http handler for this service

Types

type Config

type Config interface {
	ListenHost() string
	PrivateHTTPPort() int
	PublicHTTPPort() int
}

type PrivateHTTPDependencies

type PrivateHTTPDependencies struct {
}

PrivateHTTPDependencies is used to inject dependencies into the HTTPService service activity. Great examples of integrations to be placed into here would be a database connection or perhaps a redis client that the service activity needs to use.

type PrivateHTTPServer

type PrivateHTTPServer struct {
	*httpx.Server
	// contains filtered or unexported fields
}

PrivateHTTPServer handles internal http requests, suchs as metrics, health and readiness checks. This is required for ALL services to have.

func NewPrivateHTTPServer

func NewPrivateHTTPServer(cfg Config, deps *PrivateHTTPDependencies) *PrivateHTTPServer

NewPrivateHTTPServer creates a new HTTPService service activity.

func (*PrivateHTTPServer) Close

func (s *PrivateHTTPServer) Close(ctx context.Context) error

func (*PrivateHTTPServer) Run

func (s *PrivateHTTPServer) Run(ctx context.Context) error

Run is the entrypoint for the HTTPService serviceActivity.

type PublicHTTPDependencies

type PublicHTTPDependencies struct {
}

PublicHTTPDependencies is used to inject dependencies into the PublicHTTPService service activity. Great examples of integrations to be placed into here would be a database connection or perhaps a redis client that the service activity needs to use.

type PublicHTTPServer

type PublicHTTPServer struct {
	*httpx.Server
	// contains filtered or unexported fields
}

PublicHTTPServer handles public http service calls.

func NewPublicHTTPServer

func NewPublicHTTPServer(cfg Config, deps *PublicHTTPDependencies) *PublicHTTPServer

NewPublicHTTPServer creates a new PublicHTTPService service activity.

func (*PublicHTTPServer) Close

func (s *PublicHTTPServer) Close(ctx context.Context) error

func (*PublicHTTPServer) Run

func (s *PublicHTTPServer) Run(ctx context.Context) error

Run starts the HTTP service at the host/port specified in the config.

Jump to

Keyboard shortcuts

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