Documentation ¶
Index ¶
- Constants
- func NewFresherApplication(f FreshApplication) error
- func NewFresherCron(f FreshCron) error
- func NewImage()
- func NewImageRegistry()
- type Application
- type ApplicationOption
- type Cron
- type CronOption
- type Dictionary
- func (d *Dictionary) Delete(key string) error
- func (d *Dictionary) Exists(key string) (bool, error)
- func (d *Dictionary) Get(key string) ([]byte, error)
- func (d *Dictionary) Length(key string) (int32, error)
- func (d *Dictionary) Pop(key string) ([]byte, error)
- func (d *Dictionary) Put(key string, value []byte) error
- type FreshApplication
- type FreshApplicationPlugin
- type FreshApplicationRPC
- type FreshApplicationRPCServer
- type FreshCron
- type FreshCronPlugin
- type FreshCronRPC
- type FreshCronRPCServer
- type FreshError
- type Image
- type ImageRegistry
- type Queue
- type ResourceOption
- type Resources
- type SecretHandler
- type SecretHandlerOption
- type Volume
- type VolumeOption
Constants ¶
View Source
const ( PluginNameApplication string = "fresh-application" MagicCookieKeyApplication string = "FRESH_APPLICATION_PLUGIN" MagicCookieValueApplication string = "4ab23e44-f2c4-44c2-9b66-448d78d4713c" )
View Source
const ( PluginNameCron string = "fresh-cron" MagicCookieKeyCron string = "FRESH_CRON_PLUGIN" MagicCookieValueCron string = "" )
Variables ¶
This section is empty.
Functions ¶
func NewFresherApplication ¶
func NewFresherApplication(f FreshApplication) error
func NewFresherCron ¶
func NewImageRegistry ¶
func NewImageRegistry()
Types ¶
type Application ¶
type Application struct { Name string Image *Image ImageRegistry *ImageRegistry Resources *Resources }
func NewApplication ¶
func NewApplication(opts ...ApplicationOption) (*Application, error)
func (*Application) String ¶
func (a *Application) String() string
type ApplicationOption ¶
type ApplicationOption func(*Application)
func WithApplicationImage ¶
func WithApplicationImage(image *Image) ApplicationOption
func WithApplicationImageRegistry ¶
func WithApplicationImageRegistry(registry *ImageRegistry) ApplicationOption
func WithApplicationName ¶
func WithApplicationName(name string) ApplicationOption
func WithApplicationResource ¶
func WithApplicationResource(res *Resources) ApplicationOption
type Cron ¶
type Cron struct { Name string Image *Image ImageRegistry *ImageRegistry Resources *Resources SecretHandler *SecretHandler Dictionary *Dictionary Queue *Queue Volume *Volume }
func NewCron ¶
func NewCron(opts ...CronOption) (*Cron, error)
type CronOption ¶
type CronOption func(*Cron)
func WithCronImage ¶
func WithCronImage(image *Image) CronOption
func WithCronImageRegistry ¶
func WithCronImageRegistry(registry *ImageRegistry) CronOption
func WithCronName ¶
func WithCronName(name string) CronOption
func WithCronResource ¶
func WithCronResource(res *Resources) CronOption
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
func NewDictionary ¶
func NewDictionary() (*Dictionary, error)
func (*Dictionary) Delete ¶
func (d *Dictionary) Delete(key string) error
type FreshApplication ¶
type FreshApplication interface { // EntryPoint defines the "main" function EntryPoint() error // Shutdown defines the place to tear down things where necessary Shutdown() error // GetApplication returns the actual application containing all the information GetApplication() (*Application, error) }
type FreshApplicationPlugin ¶
type FreshApplicationPlugin struct {
Impl FreshApplication
}
func (FreshApplicationPlugin) Client ¶
func (FreshApplicationPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (*FreshApplicationPlugin) Server ¶
func (p *FreshApplicationPlugin) Server(*plugin.MuxBroker) (interface{}, error)
type FreshApplicationRPC ¶
type FreshApplicationRPC struct {
// contains filtered or unexported fields
}
func (*FreshApplicationRPC) EntryPoint ¶
func (f *FreshApplicationRPC) EntryPoint() error
func (*FreshApplicationRPC) GetApplication ¶
func (f *FreshApplicationRPC) GetApplication() (*Application, error)
func (*FreshApplicationRPC) Shutdown ¶
func (f *FreshApplicationRPC) Shutdown() error
type FreshApplicationRPCServer ¶
type FreshApplicationRPCServer struct {
Impl FreshApplication
}
func (*FreshApplicationRPCServer) EntryPoint ¶
func (s *FreshApplicationRPCServer) EntryPoint(args interface{}, resp *error) error
func (*FreshApplicationRPCServer) GetApplication ¶
func (s *FreshApplicationRPCServer) GetApplication(args interface{}, resp *Application) error
func (*FreshApplicationRPCServer) Shutdown ¶
func (s *FreshApplicationRPCServer) Shutdown(args interface{}, resp *error) error
type FreshCron ¶
type FreshCron interface { GetCron() (*Cron, error) Execute(args *pb.CronExecuteRequest) *pb.CronExecuteResponse }
type FreshCronPlugin ¶
type FreshCronPlugin struct {
Impl FreshCron
}
func (FreshCronPlugin) Client ¶
func (FreshCronPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (*FreshCronPlugin) Server ¶
func (p *FreshCronPlugin) Server(*plugin.MuxBroker) (interface{}, error)
type FreshCronRPC ¶
type FreshCronRPC struct {
// contains filtered or unexported fields
}
func (*FreshCronRPC) Execute ¶
func (f *FreshCronRPC) Execute(args *pb.CronExecuteRequest) *pb.CronExecuteResponse
func (*FreshCronRPC) GetCron ¶
func (f *FreshCronRPC) GetCron() *Cron
type FreshCronRPCServer ¶
type FreshCronRPCServer struct {
Impl FreshCron
}
func (*FreshCronRPCServer) Execute ¶
func (s *FreshCronRPCServer) Execute(args interface{}, resp *pb.CronExecuteResponse) error
func (*FreshCronRPCServer) GetCron ¶
func (s *FreshCronRPCServer) GetCron(args interface{}, resp *Cron) error
type FreshError ¶
func (*FreshError) Error ¶
func (err *FreshError) Error() string
type Image ¶
type Image struct {
Commands []string
}
func (*Image) CopyLocalDir ¶
func (*Image) CopyLocalFile ¶
func (*Image) DockerfileCommands ¶
func (*Image) RunCommands ¶
type ImageRegistry ¶
func (*ImageRegistry) Resolve ¶
func (ir *ImageRegistry) Resolve() error
func (*ImageRegistry) String ¶
func (ir *ImageRegistry) String() string
type ResourceOption ¶
type ResourceOption func(*Resources)
func WithResourcesCPU ¶
func WithResourcesCPU(value string) ResourceOption
func WithResourcesDisk ¶
func WithResourcesDisk(value string) ResourceOption
func WithResourcesMemory ¶
func WithResourcesMemory(value string) ResourceOption
type Resources ¶
func NewResource ¶
func NewResource(opts ...ResourceOption) *Resources
type SecretHandler ¶
type SecretHandler struct { ApplicationID string // contains filtered or unexported fields }
func NewSecretHandler ¶
func NewSecretHandler(applicationID string, opts ...SecretHandlerOption) (*SecretHandler, error)
type SecretHandlerOption ¶
type SecretHandlerOption func(*SecretHandler)
func WithSecretHandlerEnvFile ¶
func WithSecretHandlerEnvFile(filename string) SecretHandlerOption
func WithSecretHandlerEnvMap ¶
func WithSecretHandlerEnvMap(envMap map[string]string) SecretHandlerOption
type Volume ¶
type Volume struct { Name string Path string // Size is expressed in MB with a default of 150 Size int }
func (*Volume) WalkDirectory ¶
type VolumeOption ¶
type VolumeOption func(*Volume)
func WithVolumeSize ¶
func WithVolumeSize(size int) VolumeOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.