2019-11-19 18:09:43 +02:00
|
|
|
// Package build builds a micro runtime package
|
|
|
|
package build
|
2019-05-31 01:26:34 +02:00
|
|
|
|
|
|
|
import (
|
2021-10-12 13:55:53 +02:00
|
|
|
"go-micro.dev/v4/runtime/local/source"
|
2019-05-31 01:26:34 +02:00
|
|
|
)
|
|
|
|
|
2022-09-30 16:27:07 +02:00
|
|
|
// Builder builds binaries.
|
2019-11-19 18:09:43 +02:00
|
|
|
type Builder interface {
|
|
|
|
// Build builds a package
|
|
|
|
Build(*Source) (*Package, error)
|
|
|
|
// Clean deletes the package
|
|
|
|
Clean(*Package) error
|
2019-05-31 01:26:34 +02:00
|
|
|
}
|
|
|
|
|
2022-09-30 16:27:07 +02:00
|
|
|
// Source is the source of a build.
|
2019-05-31 01:26:34 +02:00
|
|
|
type Source struct {
|
|
|
|
// Location of the source
|
|
|
|
Repository *source.Repository
|
2023-04-26 02:16:34 +02:00
|
|
|
// Language is the language of code
|
|
|
|
Language string
|
2019-05-31 01:26:34 +02:00
|
|
|
}
|
|
|
|
|
2022-09-30 16:27:07 +02:00
|
|
|
// Package is micro service package.
|
2019-11-19 18:09:43 +02:00
|
|
|
type Package struct {
|
2023-04-26 02:16:34 +02:00
|
|
|
// Source of the binary
|
|
|
|
Source *Source
|
2019-05-31 01:26:34 +02:00
|
|
|
// Name of the binary
|
|
|
|
Name string
|
|
|
|
// Location of the binary
|
|
|
|
Path string
|
|
|
|
// Type of binary
|
|
|
|
Type string
|
|
|
|
}
|