repositories

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Name                  string                          `toml:"name" comment:"Name of this CDS Repositories Service\n Enter a name to enable this service" json:"name"`
	Basedir               string                          `toml:"basedir" comment:"Root directory where the service will store all checked-out repositories" json:"basedir"`
	OperationRetention    int                             `toml:"operationRetention" comment:"Operation retention in redis store (in days)" default:"5" json:"operationRetention"`
	RepositoriesRetention int                             `toml:"repositoriesRetention" comment:"Re retention on the filesystem (in days)" default:"10" json:"repositoriesRetention"`
	HTTP                  service.HTTPRouterConfiguration `toml:"http" comment:"######################\n CDS Repositories HTTP Configuration \n######################" json:"http"`
	URL                   string                          `default:"http://localhost:8085" json:"url"`
	API                   service.APIServiceConfiguration `toml:"api" comment:"######################\n CDS API Settings \n######################" json:"api"`
	Cache                 struct {
		TTL   int `toml:"ttl" default:"60" json:"ttl"`
		Redis struct {
			Host     string `` /* 192-byte string literal not displayed */
			Password string `toml:"password" json:"-"`
			DbIndex  int    `toml:"dbindex" default:"0" json:"dbindex"`
		} `toml:"redis" json:"redis"`
	} `toml:"cache" comment:"######################\n CDS Repositories Cache Settings \n######################" json:"cache"`
}

Configuration is the vcs configuration structure

type Service

type Service struct {
	service.Common
	Cfg    Configuration
	Router *api.Router
	Cache  cache.Store
	// contains filtered or unexported fields
}

Service is the repostories service

func New

func New() *Service

New returns a new service

func (*Service) ApplyConfiguration

func (s *Service) ApplyConfiguration(config interface{}) error

ApplyConfiguration apply an object of type repositories.Configuration after checking it

func (*Service) CheckConfiguration

func (s *Service) CheckConfiguration(config interface{}) error

CheckConfiguration checks the validity of the configuration object

func (*Service) Init

func (s *Service) Init(config interface{}) (cdsclient.ServiceConfig, error)

func (Service) Repo

func (s Service) Repo(op sdk.Operation) *sdk.OperationRepo

Repo retiens a sdk.OperationRepo from an sdk.Operation

func (*Service) Serve

func (s *Service) Serve(c context.Context) error

Serve will start the http api server

func (*Service) Status

func (s *Service) Status(ctx context.Context) *sdk.MonitoringStatus

Status returns sdk.MonitoringStatus, implements interface service.Service

Jump to

Keyboard shortcuts

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