Documentation ¶
Index ¶
- Constants
- Variables
- func ContextWithSigterm(ctx context.Context) (context.Context, context.CancelFunc)
- func EnsureDir(fp string) (bool, error)
- func EnsureRepo(ctx context.Context, cacheDir string, fetchTags bool, awsSDKGoVersion string, ...) (string, error)
- type Helper
- func (h *Helper) API(serviceModelName string) (*model.SDKAPI, error)
- func (h *Helper) FirstAPIVersion(serviceModelName string) (string, error)
- func (h *Helper) GetAPIVersions(serviceModelName string) ([]string, error)
- func (h *Helper) InjectCustomShapes(sdkapi *ackmodel.SDKAPI) error
- func (h *Helper) ModelAndDocsPath(serviceModelName string) (string, string, error)
- func (h *Helper) WithAPIVersion(apiVersion string)
- func (h *Helper) WithSDKVersion(version string) error
Constants ¶
const ( ShapeNameTemplateList = "%sList" ShapeNameTemplateMap = "%sMap" ShapeNameTemplateKey = "%sKey" )
Variables ¶
var ( ErrInvalidVersionDirectory = errors.New( "expected to find only directories in api model directory but found non-directory", ) ErrNoValidVersionDirectory = errors.New( "no valid version directories found", ) ErrServiceNotFound = errors.New( "no such service", ) ErrAPIVersionNotFound = errors.New( "no such api version", ) )
var (
ErrMemberShapeNotFound = errors.New("base shape not found")
)
Functions ¶
func ContextWithSigterm ¶ added in v0.19.3
func EnsureDir ¶ added in v0.19.3
EnsureDir makes sure that a supplied directory exists and returns whether the directory already existed.
func EnsureRepo ¶ added in v0.19.3
func EnsureRepo( ctx context.Context, cacheDir string, fetchTags bool, awsSDKGoVersion string, controllerRepoPath string, ) (string, error)
EnsureRepo ensures that we have a git clone'd copy of the aws-sdk-go repository, which we use model JSON files from. Upon successful return of this function, the sdkDir global variable will be set to the directory where the aws-sdk-go is found. It will also optionally fetch all the remote tags and checkout the given tag.
Types ¶
type Helper ¶
type Helper struct { // Default is "services.k8s.aws" APIGroupSuffix string // contains filtered or unexported fields }
Helper is a helper struct that helps work with the aws-sdk-go models and API model loader
func NewHelper ¶
func NewHelper(basePath string, cfg ackgenconfig.Config) *Helper
NewHelper returns a new SDKHelper object
func (*Helper) FirstAPIVersion ¶
FirstAPIVersion returns the first found API version for a service API. (e.h. "2012-10-03")
func (*Helper) GetAPIVersions ¶
GetAPIVersions returns the list of API Versions found in a service directory.
func (*Helper) InjectCustomShapes ¶
InjectCustomShapes will create custom shapes for each of the spec and status fields that contain CustomFieldConfig values. It will append these values into the list of shapes in the API and update the list of custom shapes in the SDKAPI object.
func (*Helper) ModelAndDocsPath ¶
ModelAndDocsPath returns two string paths to the supplied service's API and doc JSON files
func (*Helper) WithAPIVersion ¶
WithAPIVersion sets the `apiVersion` field.
func (*Helper) WithSDKVersion ¶
WithSDKVersion checks out the sdk git repository to the provided version. To use this function h.basePath should point to a git repository.