Exemple #1
0
func (r resources) registerHookContextFacade() {
	common.RegisterHookContextFacade(
		context.HookContextFacade,
		internalserver.FacadeVersion,
		r.newHookContextFacade,
		reflect.TypeOf(&internalserver.UnitFacade{}),
	)
	api.RegisterFacadeVersion(context.HookContextFacade, internalserver.FacadeVersion)
}
Exemple #2
0
func (c payloads) registerHookContextFacade() {
	const version = 0
	common.RegisterHookContextFacade(
		payloadsHookContextFacade,
		version,
		c.newHookContextFacade,
		reflect.TypeOf(&internalserver.UnitFacade{}),
	)
	api.RegisterFacadeVersion(payloadsHookContextFacade, version)
}
Exemple #3
0
// registerPublicFacade adds the resources public API facade
// to the API server.
func (r resources) registerPublicFacade() {
	if !markRegistered(resource.ComponentName, "public-facade") {
		return
	}

	common.RegisterStandardFacade(
		resource.ComponentName,
		server.Version,
		r.newPublicFacade,
	)
	api.RegisterFacadeVersion(resource.ComponentName, server.Version)
}
Exemple #4
0
func (c payloads) registerPublicFacade() {
	if !markRegistered(payload.ComponentName, "public-facade") {
		return
	}

	const version = 1
	common.RegisterStandardFacade(
		payload.ComponentName,
		version,
		c.newPublicFacade,
	)
	api.RegisterFacadeVersion(payload.ComponentName, version)
}
Exemple #5
0
func (r resources) registerHookContextFacade() {
	common.RegisterHookContextFacade(
		context.HookContextFacade,
		internalserver.FacadeVersion,
		r.newHookContextFacade,
		reflect.TypeOf(&internalserver.UnitFacade{}),
	)
	coreapi.RegisterFacadeVersion(context.HookContextFacade, internalserver.FacadeVersion)

	common.RegisterAPIModelEndpoint(internalapi.HTTPEndpointPattern, apihttp.HandlerSpec{
		Constraints: apihttp.HandlerConstraints{
			AuthKind:            names.UnitTagKind,
			StrictValidation:    true,
			ControllerModelOnly: false,
		},
		NewHandler: resourceadapters.NewDownloadHandler,
	})
}
Exemple #6
0
// registerPublicFacade adds the resources public API facade
// to the API server.
func (r resources) registerPublicFacade() {
	if !markRegistered(resource.ComponentName, "public-facade") {
		return
	}

	common.RegisterStandardFacade(
		resource.ComponentName,
		server.Version,
		resourceadapters.NewPublicFacade,
	)
	coreapi.RegisterFacadeVersion(resource.ComponentName, server.Version)

	common.RegisterAPIModelEndpoint(api.HTTPEndpointPattern, apihttp.HandlerSpec{
		Constraints: apihttp.HandlerConstraints{
			AuthKind:            names.UserTagKind,
			StrictValidation:    true,
			ControllerModelOnly: false,
		},
		NewHandler: resourceadapters.NewUploadHandler,
	})
}