Blame src/goabackend/goarestproxy.c

Packit 79f644
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
Packit 79f644
/*
Packit 79f644
 * Copyright © 2017 Red Hat, Inc.
Packit 79f644
 *
Packit 79f644
 * This library is free software; you can redistribute it and/or
Packit 79f644
 * modify it under the terms of the GNU Lesser General Public
Packit 79f644
 * License as published by the Free Software Foundation; either
Packit 79f644
 * version 2 of the License, or (at your option) any later version.
Packit 79f644
 *
Packit 79f644
 * This library is distributed in the hope that it will be useful,
Packit 79f644
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 79f644
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 79f644
 * Lesser General Public License for more details.
Packit 79f644
 *
Packit 79f644
 * You should have received a copy of the GNU Lesser General
Packit 79f644
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit 79f644
 */
Packit 79f644
Packit 79f644
#include "config.h"
Packit 79f644
Packit 79f644
#include "goarestproxy.h"
Packit 79f644
#include "goasouplogger.h"
Packit 79f644
Packit 79f644
struct _GoaRestProxy
Packit 79f644
{
Packit 79f644
  RestProxy parent_instance;
Packit 79f644
};
Packit 79f644
Packit 79f644
struct _GoaRestProxyClass
Packit 79f644
{
Packit 79f644
  RestProxyClass parent_class;
Packit 79f644
};
Packit 79f644
Packit 79f644
G_DEFINE_TYPE (GoaRestProxy, goa_rest_proxy, REST_TYPE_PROXY);
Packit 79f644
Packit 79f644
/* ---------------------------------------------------------------------------------------------------- */
Packit 79f644
Packit 79f644
static void
Packit 79f644
goa_rest_proxy_constructed (GObject *object)
Packit 79f644
{
Packit 79f644
  GoaRestProxy *self = GOA_REST_PROXY (object);
Packit 79f644
  SoupLogger *logger = NULL;
Packit 79f644
Packit 79f644
  G_OBJECT_CLASS (goa_rest_proxy_parent_class)->constructed (object);
Packit 79f644
Packit 79f644
  logger = goa_soup_logger_new (SOUP_LOGGER_LOG_BODY, -1);
Packit 79f644
  rest_proxy_add_soup_feature (REST_PROXY (self), SOUP_SESSION_FEATURE (logger));
Packit 79f644
  g_object_unref (logger);
Packit 79f644
}
Packit 79f644
Packit 79f644
static void
Packit 79f644
goa_rest_proxy_init (GoaRestProxy *self)
Packit 79f644
{
Packit 79f644
}
Packit 79f644
Packit 79f644
static void
Packit 79f644
goa_rest_proxy_class_init (GoaRestProxyClass *klass)
Packit 79f644
{
Packit 79f644
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
Packit 79f644
  gobject_class->constructed = goa_rest_proxy_constructed;
Packit 79f644
}
Packit 79f644
Packit 79f644
/* ---------------------------------------------------------------------------------------------------- */
Packit 79f644
Packit 79f644
RestProxy *
Packit 79f644
goa_rest_proxy_new (const gchar  *url_format,
Packit 79f644
                    gboolean      binding_required)
Packit 79f644
{
Packit 79f644
  return g_object_new (GOA_TYPE_REST_PROXY, "url-format", url_format, "binding-required", binding_required, NULL);
Packit 79f644
}