Documentation
¶
Index ¶
- Constants
- func AliasFilePaths(assets []*ReleaseAsset) ([]string, error)
- func CreateLink(ctx context.Context, c *gitlab.Client, projectID, tagName string, ...) (*gitlab.ReleaseLink, bool, error)
- func ToReleaseAssetsOptions(assets []*ReleaseAsset) *gitlab.ReleaseAssetsOptions
- type ConflictDirectAssetPathError
- type Context
- func (c *Context) CreateReleaseAssetLinks(ctx context.Context, projectID string, tagName string) error
- func (c *Context) UploadAssetFiles(ctx context.Context, projectID, tagName string, packageName string, ...) ([]*ReleaseAsset, error)
- func (c *Context) UploadFiles(ctx context.Context, projectID, tagName string, packageName string, ...) error
- type ReleaseAsset
- type ReleaseFile
Constants ¶
View Source
const DefaultReleasePackageName = "release-assets"
DefaultReleasePackageName contains the name for the release asset package
Variables ¶
This section is empty.
Functions ¶
func AliasFilePaths ¶ added in v1.125.0
func AliasFilePaths(assets []*ReleaseAsset) ([]string, error)
AliasFilePaths returns the names of the assets whose deprecated filepath it moved to direct_asset_path.
func CreateLink ¶
func CreateLink(ctx context.Context, c *gitlab.Client, projectID, tagName string, asset *ReleaseAsset) (*gitlab.ReleaseLink, bool, error)
func ToReleaseAssetsOptions ¶ added in v1.125.0
func ToReleaseAssetsOptions(assets []*ReleaseAsset) *gitlab.ReleaseAssetsOptions
ToReleaseAssetsOptions ignores the deprecated filepath. Call AliasFilePaths first.
Types ¶
type ConflictDirectAssetPathError ¶
type ConflictDirectAssetPathError struct {
// contains filtered or unexported fields
}
ConflictDirectAssetPathError is returned when both direct_asset_path and the deprecated filepath as specified for an asset link.
func (*ConflictDirectAssetPathError) Error ¶
func (e *ConflictDirectAssetPathError) Error() string
type Context ¶
type Context struct {
Client *gitlab.Client
IO *iostreams.IOStreams
AssetFiles []*ReleaseFile
AssetsLinks []*ReleaseAsset
}
func (*Context) CreateReleaseAssetLinks ¶
func (*Context) UploadAssetFiles ¶ added in v1.125.0
func (c *Context) UploadAssetFiles(ctx context.Context, projectID, tagName string, packageName string, usePackageRegistry bool) ([]*ReleaseAsset, error)
UploadAssetFiles does not link the files. The release may not exist yet.
func (*Context) UploadFiles ¶
func (c *Context) UploadFiles(ctx context.Context, projectID, tagName string, packageName string, usePackageRegistry bool) error
UploadFiles uploads the asset files concurrently and then creates their release links in input order, so the release lists assets deterministically.
type ReleaseAsset ¶
type ReleaseAsset struct {
Name *string `json:"name,omitempty"`
URL *string `json:"url,omitempty"`
// Deprecated FilePath use DirectAssetPath instead.
FilePath *string `json:"filepath,omitempty"`
DirectAssetPath *string `json:"direct_asset_path,omitempty"`
LinkType *gitlab.LinkTypeValue `json:"link_type,omitempty"`
}
type ReleaseFile ¶
type ReleaseFile struct {
Open func() (io.ReadCloser, error)
Name string
Label string
Path string
Type *gitlab.LinkTypeValue
}
Click to show internal directories.
Click to hide internal directories.