server

package
v0.0.0-...-5ad8e69 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEventID

func GetEventID(data []byte) string

Types

type ClientCallback

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

func (*ClientCallback) EventSink

func (c *ClientCallback) EventSink(ctx context.Context, event relay.Event) (string, error)

func (*ClientCallback) OnConnectionStatusChange

func (c *ClientCallback) OnConnectionStatusChange(
	ctx context.Context,
	cancel context.CancelCauseFunc,
	client relay.RelayClient,
	remoteServerIdentity string,
	status bool,
)

type RelayServerApp

type RelayServerApp struct{}

func (*RelayServerApp) Run

func (r *RelayServerApp) Run() error

type RelayServerCli

type RelayServerCli struct {
	Server  struct{} `cmd:"" help:"Run relay server."`
	Migrate struct {
		Migrations string `short:"p" long:"path" type:"existingdir" help:"Path to the migration files" default:"migrations"`
	} `cmd:"" help:"Migrate database."`
	Config string `short:"c" long:"config" type:"existingfile" help:"Path to the configuration file" default:"config.yaml"`
}

type RelayServerConfig

type RelayServerConfig struct {
	Database     util.PostgresDatabaseConfig `yaml:"database"`
	LocalAddress string                      `yaml:"local_address"`
	OtherPeers   []string                    `yaml:"other_peers"`
	OTLPEndpoint string                      `yaml:"otlp_endpoint"`
}

type Server

type Server struct {
	io.Closer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(options ...ServerOption) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run() error

type ServerConfig

type ServerConfig struct {
	DbConfig     util.PostgresDatabaseConfig `yaml:"db_config"`
	LocalAddress string                      `yaml:"local_address"`
	OtherPeers   []string                    `yaml:"other_peers"` // Set the server to connect to other servers to pull data from them.
}

type ServerOption

type ServerOption func(s *Server)

func WithLocalAddress

func WithLocalAddress(address string) ServerOption

func WithPeers

func WithPeers(peers []string) ServerOption

func WithStorage

func WithStorage(storage storage.RelayServerDataStore) ServerOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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