1
0
Fork 0
golang-forgejo-f3-gof3/forges/gitlab/common.go
Daniel Baumann 03bfe4079e
Adding upstream version 3.10.8.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-05-18 09:37:23 +02:00

84 lines
1.9 KiB
Go

// Copyright Earl Warren <contact@earl-warren.org>
// Copyright Loïc Dachary <loic@dachary.org>
// SPDX-License-Identifier: MIT
package gitlab
import (
"context"
"code.forgejo.org/f3/gof3/v3/id"
"code.forgejo.org/f3/gof3/v3/kind"
options_http "code.forgejo.org/f3/gof3/v3/options/http"
f3_tree "code.forgejo.org/f3/gof3/v3/tree/f3"
"code.forgejo.org/f3/gof3/v3/tree/generic"
"github.com/hashicorp/go-version"
"gitlab.com/gitlab-org/api/client-go"
)
type common struct {
generic.NullDriver
}
func (o *common) GetHelper() any {
panic("not implemented")
}
func (o *common) ListPage(ctx context.Context, page int) generic.ChildrenSlice {
return generic.NewChildrenSlice(0)
}
func (o *common) getTree() generic.TreeInterface {
return o.GetNode().GetTree()
}
func (o *common) getPageSize() int {
return o.getTreeDriver().GetPageSize()
}
func (o *common) getF3Tree() f3_tree.TreeInterface {
return o.getTree().(f3_tree.TreeInterface)
}
func (o *common) getKind() kind.Kind {
return o.GetNode().GetKind()
}
func (o *common) getChildDriver(kind kind.Kind) generic.NodeDriverInterface {
return o.GetNode().GetChild(id.NewNodeID(kind)).GetDriver()
}
func (o *common) isContainer() bool {
return o.getF3Tree().IsContainer(o.getKind())
}
func (o *common) getURL() string {
return o.getTreeDriver().options.GetURL()
}
func (o *common) getPushURL() string {
return o.getTreeDriver().options.GetPushURL()
}
func (o *common) getNewMigrationHTTPClient() options_http.NewMigrationHTTPClientFun {
return o.getTreeDriver().options.GetNewMigrationHTTPClient()
}
func (o *common) getTreeDriver() *treeDriver {
return o.GetTreeDriver().(*treeDriver)
}
func (o *common) getIsAdmin() bool {
return o.getTreeDriver().GetIsAdmin()
}
func (o *common) getClient() *gitlab.Client {
return o.getTreeDriver().GetClient()
}
func (o *common) getVersion() *version.Version {
return o.getTreeDriver().GetVersion()
}
func (o *common) IsNull() bool { return false }