api

package
v0.0.0-...-ce37fa3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EcrClient

func EcrClient(region string) (*ecr.Client, error)

ECR クライアント生成

func EcrDescribeImages

func EcrDescribeImages(ctx context.Context, api EcrDescribeImagesAPI, repositoryName string, registryId string) ([]types.ImageDetail, error)

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func ReadSettings

func ReadSettings(pathPrefix string) (*[]UriSetting, error)

ファイルシステムから必要情報を取得

func RegisterHandlers

func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type ECRAPI

type ECRAPI interface {
	EcrDescribeImagesAPI
}

ECR API interface

type EcrDescribeImagesAPI

type EcrDescribeImagesAPI interface {
	DescribeImages(ctx context.Context, params *ecr.DescribeImagesInput, optFns ...func(*ecr.Options)) (*ecr.DescribeImagesOutput, error)
}

ECR DescribeImages

type Error

type Error struct {
	Message string `json:"message"`
}

Error エラーメッセージモデル

type ErrorResponse

type ErrorResponse = Error

ErrorResponse エラーメッセージモデル

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type LastReleased

type LastReleased struct {
	ImageUri   string    `json:"image_uri"`
	ReleasedAt time.Time `json:"released_at"`
}

LastReleased 最終リリース設定モデル

func ReadLastReleased

func ReadLastReleased(settingPath string, serviceName string) *LastReleased

前回リリース時設定読み込み

type ListSettings

type ListSettings struct {
	ConfigPathPrefix string
	TagRepositoryUri string
	TagKeys          *[]TagKey
}

func NewListSettings

func NewListSettings(configPathPrefix string, tagRepositoryUri string, tagKeys *[]TagKey) *ListSettings

func (*ListSettings) GetTagSettings

func (l *ListSettings) GetTagSettings(c *gin.Context)

リリース設定一覧の取得(タグ指定分)

func (*ListSettings) GetUriSettings

func (l *ListSettings) GetUriSettings(c *gin.Context)

リリース設定一覧の取得(URI指定分)

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type NextRelease

type NextRelease struct {
	ImageUri  string    `json:"image_uri"`
	ReleaseAt time.Time `json:"release_at"`
}

NextRelease リリース待ち設定モデル

func ReadNextRelease

func ReadNextRelease(settingPath string, serviceName string) *NextRelease

次回リリース設定読み込み

type ServerInterface

type ServerInterface interface {
	// リリース設定の取得(タグ指定分)
	// (GET /tagSettings)
	GetTagSettings(c *gin.Context)
	// リリース設定の取得(URI指定分)
	// (GET /uriSettings)
	GetUriSettings(c *gin.Context)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetTagSettings

func (siw *ServerInterfaceWrapper) GetTagSettings(c *gin.Context)

GetTagSettings operation middleware

func (*ServerInterfaceWrapper) GetUriSettings

func (siw *ServerInterfaceWrapper) GetUriSettings(c *gin.Context)

GetUriSettings operation middleware

type SettingItems

type SettingItems struct {
	ImageUri  string
	ReleaseAt time.Time
}

func ReadSettingFromFile

func ReadSettingFromFile(settingFile string) (*SettingItems, error)

指定ファイルから設定を取得

type TagKey

type TagKey struct {
	TagName         string
	EnvironmentName string
}

type TagSetting

type TagSetting struct {
	EnvironmentName string     `json:"environment_name"`
	PushedAt        *time.Time `json:"pushed_at,omitempty"`

	// Tags 1つも存在しなかった場合は要素が1つだけの配列として文字列「(未指定)」を返す
	Tags []string `json:"tags"`
}

TagSetting タグ形式リリース設定モデル

func GetTagSettingList

func GetTagSettingList(imageDetails []types.ImageDetail, tagKeys []TagKey) []TagSetting

TagSettingList を取得

func TagSettingList

func TagSettingList(ctx context.Context, api ECRAPI, repositoryUri string, tagKeys []TagKey) ([]TagSetting, error)

ECR リポジトリ内イメージ一覧取得

type TagSettingResponse

type TagSettingResponse = []TagSetting

TagSettingResponse defines model for tagSettingResponse.

type UriSetting

type UriSetting struct {
	EnvironmentName string `json:"environment_name"`

	// LastReleased 最終リリース設定モデル
	LastReleased *LastReleased `json:"last_released,omitempty"`

	// NextRelease リリース待ち設定モデル
	NextRelease *NextRelease `json:"next_release,omitempty"`
	ServiceName string       `json:"service_name"`
}

UriSetting URI形式リリース設定モデル

type UriSettingResponse

type UriSettingResponse = []UriSetting

UriSettingResponse defines model for uriSettingResponse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL