Documentation ¶
Index ¶
Constants ¶
const ParamsCounts = 4
Variables ¶
This section is empty.
Functions ¶
func NewHTTPBackend ¶
Types ¶
type HTTPBackend ¶
type HTTPBackend struct {
HTTPState
}
func (*HTTPBackend) ConfigSchema ¶
func (b *HTTPBackend) ConfigSchema() cty.Type
ConfigSchema is an implementation of StateStorage.ConfigSchema
func (*HTTPBackend) Configure ¶
func (b *HTTPBackend) Configure(obj cty.Value) error
Configure is an implementation of StateStorage.Configure
func (*HTTPBackend) StateStorage ¶
func (b *HTTPBackend) StateStorage() states.StateStorage
StateStorage return a StateStorage to manage http State
type HTTPState ¶
type HTTPState struct {
// contains filtered or unexported fields
}
HTTPState represent a remote state that can be requested by HTTP. This state is designed to provide a generic way to manipulate State in third-party services
Some url formats are given to bring relative flexibility for third-party services to implement their own State HTTP service and these formats MUST contain 4 "%s" placeholders for tenant, project and stack, since we will replace this format with fmt.Sprintf() Let's get applyURLFormat as an example to demonstrate how this suffix format works.
Example: urlPrefix = "http://kusionstack.io" applyURLFormat = "/apis/v1/tenants/%s/projects/%s/stacks/%s/clusters/%s/states/" tenant = "t" project = "p" stack = "s" cluster = "c" the final request URL = "http://kusionstack.io/apis/v1/tenants/t/projects/p/stacks/s/clusters/c/states"
func (*HTTPState) GetLatestState ¶
GetLatestState is an implementation of StateStorage.GetLatestState