module

package
v0.0.0-...-a83c1e6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitConfigRequest

type GitConfigRequest struct {
	Repository string `json:"repository" validate:"required"`
	Branch     string `json:"branch" validate:"required,min=4,max=20"`
	Username   string `json:"username"`
	Password   string `json:"password"`
}

GitConfigRequest struct represents the git configuration for a module

type ModuleRequest

type ModuleRequest struct {
	Name string `json:"name" validate:"required,min=4,max=20"`
}

ModuleRequest struct represents the module configuration

type Service

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

Service struct manages interactions with activities store

func New

func New(db *gorm.DB) Service

New creates a new Service struct

func (*Service) Create

func (s *Service) Create(request ModuleRequest, ctx context.Context) (module.Module, error)

Create creates a new module entry in the database

func (*Service) Delete

func (s *Service) Delete(id int, ctx context.Context) error

Delete deletes a module entry to the database

func (*Service) GetGitConfig

func (s *Service) GetGitConfig(id int) (GitConfigRequest, error)

GetGitConfig retrieves the git configuration from a module

func (*Service) List

func (s *Service) List() ([]module.Module, error)

List retrieves all module entries from the database This function is used only for internal purposes

func (*Service) PaginateList

func (s *Service) PaginateList(ctx *gin.Context) ([]module.Module, error)

PaginateList retrieves a paginated list of module entries from the database

func (*Service) Read

func (s *Service) Read(id int) (module.Module, error)

Read retrieves a module entry from the database

func (*Service) SetGitConfig

func (s *Service) SetGitConfig(id int, request GitConfigRequest, ctx context.Context) error

SetGitConfig sets the git configuration to a module

Jump to

Keyboard shortcuts

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