vcluster_fs_syncer

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Overview

Package vcluster_fs_syncer contains the base activities that make up the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenHost string `yaml:"ListenHost"`
	HTTPPort   int    `yaml:"HTTPPort"`

	// <<Stencil::Block(config)>>
	FromPath string `yaml:"fromPath"`
	ToPath   string `yaml:"toPath"`
}

Config tracks config needed for vcluster-fs-syncer

func LoadConfig

func LoadConfig(ctx context.Context) (*Config, error)

LoadConfig returns a new Config type that has been loaded in accordance to the environment that the service was deployed in, with all necessary tweaks made before returning. nolint: funlen // Why: This function is long for extensibility reasons since it is generated by stencil.

func (*Config) MarshalLog

func (c *Config) MarshalLog(addfield func(key string, value interface{}))

MarshalLog can be used to write config to log

type HTTPService

type HTTPService struct {
	handlers.Service
	// contains filtered or unexported fields
}

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

func NewHTTPService

func NewHTTPService(cfg *Config, deps *PrivateHTTPDependencies) *HTTPService

NewHTTPService creates a new HTTPService service activity.

func (*HTTPService) Run

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

Run is the entrypoint for the HTTPService serviceActivity.

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 SyncerService

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

SyncerService implements the ServiceActivity framework for the vcluster-fs-syncer service. This service activity is the wrapper for all logic that is required to run the service.

func NewSyncerService

func NewSyncerService(cfg *Config) *SyncerService

NewSyncerService create a new SyncerService that implements the core of this service's logic.

func (*SyncerService) Close

func (s *SyncerService) Close(_ context.Context) error

Close shuts down the SyncerService.

func (*SyncerService) Run

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

Run starts the SyncerService.

Jump to

Keyboard shortcuts

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