Documentation ¶
Overview ¶
Package module is reponsible for registry modules
Index ¶
- Constants
- Variables
- type CreateModuleVersionOptions
- type CreateOptions
- type GetModuleOptions
- type ListModulesOptions
- type Module
- type ModuleList
- type ModuleStatus
- type ModuleVersion
- type ModuleVersionStatus
- type Options
- type PublishOptions
- type PublishVersionOptions
- type Repo
- type Service
- func (s *Service) AddHandlers(r *mux.Router)
- func (s *Service) CreateModule(ctx context.Context, opts CreateOptions) (*Module, error)
- func (s *Service) CreateVersion(ctx context.Context, opts CreateModuleVersionOptions) (*ModuleVersion, error)
- func (s *Service) DeleteModule(ctx context.Context, id resource.ID) (*Module, error)
- func (s *Service) GetModule(ctx context.Context, opts GetModuleOptions) (*Module, error)
- func (s *Service) GetModuleByConnection(ctx context.Context, vcsProviderID resource.ID, repoPath string) (*Module, error)
- func (s *Service) GetModuleByID(ctx context.Context, id resource.ID) (*Module, error)
- func (s *Service) GetModuleInfo(ctx context.Context, versionID resource.ID) (*TerraformModule, error)
- func (s *Service) ListModules(ctx context.Context, opts ListModulesOptions) ([]*Module, error)
- func (s *Service) PublishModule(ctx context.Context, opts PublishOptions) (*Module, error)
- func (s *Service) PublishVersion(ctx context.Context, opts PublishVersionOptions) error
- type TerraformModule
- type UpdateModuleVersionStatusOptions
Constants ¶
const ( ModuleStatusPending ModuleStatus = "pending" ModuleStatusNoVersionTags ModuleStatus = "no_version_tags" ModuleStatusSetupFailed ModuleStatus = "setup_failed" ModuleStatusSetupComplete ModuleStatus = "setup_complete" ModuleVersionStatusPending ModuleVersionStatus = "pending" ModuleVersionStatusCloning ModuleVersionStatus = "cloning" ModuleVersionStatusCloneFailed ModuleVersionStatus = "clone_failed" ModuleVersionStatusRegIngressReqFailed ModuleVersionStatus = "reg_ingress_req_failed" ModuleVersionStatusRegIngressing ModuleVersionStatus = "reg_ingressing" ModuleVersionStatusRegIngressFailed ModuleVersionStatus = "reg_ingress_failed" ModuleVersionStatusOK ModuleVersionStatus = "ok" )
Variables ¶
var ErrInvalidModuleRepo = errors.New("invalid repository name for module")
Functions ¶
This section is empty.
Types ¶
type CreateOptions ¶
type GetModuleOptions ¶
type ListModulesOptions ¶
type ListModulesOptions struct {
Organization string `schema:"organization_name,required"` // filter by organization name
}
type Module ¶
type Module struct { ID resource.ID CreatedAt time.Time UpdatedAt time.Time Name string Provider string Organization string // Module belongs to an organization Status ModuleStatus Versions []ModuleVersion // versions sorted in descending order Connection *connections.Connection // optional vcs repo connection }
func (*Module) AvailableVersions ¶
func (m *Module) AvailableVersions() (avail []ModuleVersion)
func (*Module) Latest ¶
func (m *Module) Latest() *ModuleVersion
Latest retrieves the latest version, which is the greatest version with an ok status. If there is no such version, nil is returned.
func (*Module) Version ¶
func (m *Module) Version(v string) *ModuleVersion
type ModuleList ¶
type ModuleList struct { *resource.Pagination Items []*Module }
type ModuleStatus ¶
type ModuleStatus string
type ModuleVersion ¶
type ModuleVersion struct { ID resource.ID ModuleID resource.ID Version string CreatedAt time.Time UpdatedAt time.Time Status ModuleVersionStatus StatusError string }
func (*ModuleVersion) LogValue ¶ added in v0.1.10
func (v *ModuleVersion) LogValue() slog.Value
type ModuleVersionStatus ¶
type ModuleVersionStatus string
type Options ¶
type Options struct { logr.Logger *sql.DB *internal.HostnameService *surl.Signer html.Renderer Authorizer *authz.Authorizer RepohookService *repohooks.Service VCSProviderService *vcsprovider.Service ConnectionsService *connections.Service VCSEventSubscriber vcs.Subscriber }
type PublishOptions ¶
type PublishVersionOptions ¶
type Repo ¶
type Repo string
Repo is the path of repository for a module. It is expected to follow a certain format, which varies according to the cloud providing the Repo, but it should always end with '/<identifier>-<name>-<provider>', with name and provider being used to set the name and provider of the module.
type Service ¶
type Service struct { logr.Logger *authz.Authorizer // contains filtered or unexported fields }
func NewService ¶
func (*Service) AddHandlers ¶ added in v0.2.2
func (*Service) CreateModule ¶
func (*Service) CreateVersion ¶
func (s *Service) CreateVersion(ctx context.Context, opts CreateModuleVersionOptions) (*ModuleVersion, error)
func (*Service) DeleteModule ¶
func (*Service) GetModuleByConnection ¶ added in v0.1.14
func (*Service) GetModuleByID ¶
func (*Service) GetModuleInfo ¶
func (*Service) ListModules ¶
func (*Service) PublishModule ¶
PublishModule publishes a new module from a VCS repository, enumerating through its git tags and releasing a module version for each tag.
func (*Service) PublishVersion ¶
func (s *Service) PublishVersion(ctx context.Context, opts PublishVersionOptions) error
PublishVersion publishes a module version, retrieving its contents from a repository and uploading it to the module store.
type TerraformModule ¶
TerraformModule is a module of terraform configuration
type UpdateModuleVersionStatusOptions ¶
type UpdateModuleVersionStatusOptions struct { ID resource.ID Status ModuleVersionStatus Error string }