mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-08 02:37:04 +00:00
refactor: move things to packages
This commit is contained in:
parent
44184a77f9
commit
11063b2d2c
32 changed files with 923 additions and 892 deletions
19
internal/updater/updater.go
Normal file
19
internal/updater/updater.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package updater
|
||||
|
||||
type ReleaseInfo struct {
|
||||
Version string
|
||||
ChangelogEntry string
|
||||
}
|
||||
|
||||
type Updater func(string) (string, error)
|
||||
|
||||
type NewUpdater func(ReleaseInfo) Updater
|
||||
|
||||
func WithInfo(info ReleaseInfo, constructors ...NewUpdater) []Updater {
|
||||
updaters := make([]Updater, 0, len(constructors))
|
||||
for _, constructor := range constructors {
|
||||
updaters = append(updaters, constructor(info))
|
||||
}
|
||||
|
||||
return updaters
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue