Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDraftNotFound = errors.New("draft content not found in PAC") ErrDraftNotValid = errors.New("draft content is invalid") ErrDraftContentTypeNotSupported = errors.New("draft content-type is invalid") )
View Source
var ( AllowedOriginSystemIDValues = map[string]struct{}{} AllowedContentTypes = map[string]struct{}{} )
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v1.2.4
type API struct {
// contains filtered or unexported fields
}
func NewContentAPI ¶
type DraftContentRW ¶
type DraftContentRW interface { Read(ctx context.Context, contentUUID string, log *logger.UPPLogger) (io.ReadCloser, error) Write(ctx context.Context, contentUUID string, content *string, headers map[string]string, log *logger.UPPLogger) error GTG() error Endpoint() string }
func NewDraftContentRWService ¶
func NewDraftContentRWService(endpoint string, resolver DraftContentValidatorResolver, httpClient *http.Client) DraftContentRW
type DraftContentValidator ¶ added in v1.2.4
type DraftContentValidator interface { Validate(ctx context.Context, contentUUID string, nativeBody io.Reader, contentType string, log *logger.UPPLogger) (io.ReadCloser, error) GTG() error Endpoint() string }
func NewSparkDraftContentValidatorService ¶ added in v1.2.4
func NewSparkDraftContentValidatorService(endpoint string, httpClient *http.Client) DraftContentValidator
type DraftContentValidatorResolver ¶ added in v1.2.4
type DraftContentValidatorResolver interface { // ValidatorForContentType Resolves and returns a DraftContentValidator implementation if present. ValidatorForContentType(contentType string) (DraftContentValidator, error) }
DraftContentValidatorResolver manages the validators available for a given originId/content-type pair.
func NewDraftContentValidatorResolver ¶ added in v1.2.4
func NewDraftContentValidatorResolver(contentTypeToValidator map[string]DraftContentValidator) DraftContentValidatorResolver
NewDraftContentValidatorResolver returns a DraftContentValidatorResolver implementation
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(uppAPI contentProviderAPI, draftContentRW DraftContentRW, timeout time.Duration, log *logger.UPPLogger) *Handler
func (*Handler) ReadContent ¶
func (h *Handler) ReadContent(w http.ResponseWriter, r *http.Request)
func (*Handler) WriteNativeContent ¶
func (h *Handler) WriteNativeContent(w http.ResponseWriter, r *http.Request)
type ValidatorError ¶ added in v1.2.4
type ValidatorError struct {
// contains filtered or unexported fields
}
func (ValidatorError) Error ¶ added in v1.2.4
func (e ValidatorError) Error() string
func (ValidatorError) StatusCode ¶ added in v1.2.4
func (e ValidatorError) StatusCode() int
Click to show internal directories.
Click to hide internal directories.