Documentation ¶
Overview ¶
Package neoforge is a generated GoMock package.
Index ¶
- Variables
- func FetchRemote() (neoforgeClient.Versions, error)
- type GormService
- func (s *GormService) AttachBuild(ctx context.Context, params model.NeoforgeBuildParams) error
- func (s *GormService) DropBuild(ctx context.Context, params model.NeoforgeBuildParams) error
- func (s *GormService) List(ctx context.Context, params model.ListParams) ([]*model.Neoforge, int64, error)
- func (s *GormService) ListBuilds(ctx context.Context, params model.NeoforgeBuildParams) ([]*model.Build, int64, error)
- func (s *GormService) Show(ctx context.Context, name string) (*model.Neoforge, error)
- func (s *GormService) Sync(ctx context.Context, versions neoforgeClient.Versions) error
- func (s *GormService) WithPrincipal(principal *model.User) Service
- type MockService
- func (m *MockService) AttachBuild(arg0 context.Context, arg1 model.NeoforgeBuildParams) error
- func (m *MockService) DropBuild(arg0 context.Context, arg1 model.NeoforgeBuildParams) error
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) List(arg0 context.Context, arg1 model.ListParams) ([]*model.Neoforge, int64, error)
- func (m *MockService) ListBuilds(arg0 context.Context, arg1 model.NeoforgeBuildParams) ([]*model.Build, int64, error)
- func (m *MockService) Show(arg0 context.Context, arg1 string) (*model.Neoforge, error)
- func (m *MockService) Sync(arg0 context.Context, arg1 neoforge.Versions) error
- func (m *MockService) WithPrincipal(arg0 *model.User) Service
- type MockServiceMockRecorder
- func (mr *MockServiceMockRecorder) AttachBuild(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) DropBuild(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) ListBuilds(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) Show(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) Sync(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) WithPrincipal(arg0 interface{}) *gomock.Call
- type Service
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when a neoforge was not found. ErrNotFound = errors.New("neoforge not found") ErrSyncUnavailable = errors.New("neoforge version service is unavailable") // ErrAlreadyAssigned defines the error if a build is already assigned. ErrAlreadyAssigned = errors.New("is already attached") // ErrNotAssigned defines the error if a build is not assigned. ErrNotAssigned = errors.New("is not attached") )
Functions ¶
func FetchRemote ¶
func FetchRemote() (neoforgeClient.Versions, error)
FetchRemote is just a wrapper to get a syncable list of versions.
Types ¶
type GormService ¶
type GormService struct {
// contains filtered or unexported fields
}
GormService defines the service to store content within a database based on Gorm.
func NewGormService ¶
func NewGormService( handle *gorm.DB, cfg *config.Config, ) *GormService
NewGormService initializes the service to store content within a database based on Gorm.
func (*GormService) AttachBuild ¶
func (s *GormService) AttachBuild(ctx context.Context, params model.NeoforgeBuildParams) error
AttachBuild implements the Service interface for database persistence.
func (*GormService) DropBuild ¶
func (s *GormService) DropBuild(ctx context.Context, params model.NeoforgeBuildParams) error
DropBuild implements the Service interface for database persistence.
func (*GormService) List ¶
func (s *GormService) List(ctx context.Context, params model.ListParams) ([]*model.Neoforge, int64, error)
List implements the Service interface for database persistence.
func (*GormService) ListBuilds ¶
func (s *GormService) ListBuilds(ctx context.Context, params model.NeoforgeBuildParams) ([]*model.Build, int64, error)
ListBuilds implements the Service interface for database persistence.
func (*GormService) Sync ¶
func (s *GormService) Sync(ctx context.Context, versions neoforgeClient.Versions) error
Sync implements the Store interface for database persistence.
func (*GormService) WithPrincipal ¶
func (s *GormService) WithPrincipal(principal *model.User) Service
WithPrincipal implements the Service interface for database persistence.
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of Service interface.
func NewMockService ¶
func NewMockService(ctrl *gomock.Controller) *MockService
NewMockService creates a new mock instance.
func (*MockService) AttachBuild ¶
func (m *MockService) AttachBuild(arg0 context.Context, arg1 model.NeoforgeBuildParams) error
AttachBuild mocks base method.
func (*MockService) DropBuild ¶
func (m *MockService) DropBuild(arg0 context.Context, arg1 model.NeoforgeBuildParams) error
DropBuild mocks base method.
func (*MockService) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockService) List ¶
func (m *MockService) List(arg0 context.Context, arg1 model.ListParams) ([]*model.Neoforge, int64, error)
List mocks base method.
func (*MockService) ListBuilds ¶
func (m *MockService) ListBuilds(arg0 context.Context, arg1 model.NeoforgeBuildParams) ([]*model.Build, int64, error)
ListBuilds mocks base method.
func (*MockService) WithPrincipal ¶
func (m *MockService) WithPrincipal(arg0 *model.User) Service
WithPrincipal mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) AttachBuild ¶
func (mr *MockServiceMockRecorder) AttachBuild(arg0, arg1 interface{}) *gomock.Call
AttachBuild indicates an expected call of AttachBuild.
func (*MockServiceMockRecorder) DropBuild ¶
func (mr *MockServiceMockRecorder) DropBuild(arg0, arg1 interface{}) *gomock.Call
DropBuild indicates an expected call of DropBuild.
func (*MockServiceMockRecorder) List ¶
func (mr *MockServiceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockServiceMockRecorder) ListBuilds ¶
func (mr *MockServiceMockRecorder) ListBuilds(arg0, arg1 interface{}) *gomock.Call
ListBuilds indicates an expected call of ListBuilds.
func (*MockServiceMockRecorder) Show ¶
func (mr *MockServiceMockRecorder) Show(arg0, arg1 interface{}) *gomock.Call
Show indicates an expected call of Show.
func (*MockServiceMockRecorder) Sync ¶
func (mr *MockServiceMockRecorder) Sync(arg0, arg1 interface{}) *gomock.Call
Sync indicates an expected call of Sync.
func (*MockServiceMockRecorder) WithPrincipal ¶
func (mr *MockServiceMockRecorder) WithPrincipal(arg0 interface{}) *gomock.Call
WithPrincipal indicates an expected call of WithPrincipal.
type Service ¶
type Service interface { List(context.Context, model.ListParams) ([]*model.Neoforge, int64, error) Show(context.Context, string) (*model.Neoforge, error) Sync(context.Context, neoforgeClient.Versions) error ListBuilds(context.Context, model.NeoforgeBuildParams) ([]*model.Build, int64, error) AttachBuild(context.Context, model.NeoforgeBuildParams) error DropBuild(context.Context, model.NeoforgeBuildParams) error WithPrincipal(*model.User) Service }
Service handles all interactions with neoforge.
func NewLoggingService ¶
NewLoggingService wraps the Service and provides logging for its methods.
func NewMetricsService ¶
NewMetricsService wraps the Service and provides metrics for its methods.
func NewService ¶
NewService returns a Service that handles all interactions with neoforge.