github.com/motyar/up@v0.2.10/config/lambda.go (about) 1 package config 2 3 import "errors" 4 5 // Lambda configuration. 6 type Lambda struct { 7 Role string `json:"role"` 8 9 // Memory of the function. 10 Memory int `json:"memory"` 11 12 // Timeout of the function. 13 Timeout int `json:"timeout"` 14 } 15 16 // Default implementation. 17 func (l *Lambda) Default() error { 18 if l.Memory == 0 { 19 l.Memory = 512 20 } 21 22 return nil 23 } 24 25 // Validate implementation. 26 func (l *Lambda) Validate() error { 27 if l.Timeout != 0 { 28 return errors.New(".lambda.timeout is deprecated, use .proxy.timeout") 29 } 30 31 return nil 32 }