Sha256: b7998943c3dcb581dc2bb09bc7a86b9f365bbece0c22be1790d2ffa4247684d7

Contents?: true

Size: 1.43 KB

Versions: 20

Compression:

Stored size: 1.43 KB

Contents

module Gitea
  module Api
    class Client 

      # 构造Api client,用于操作Api数据
      # @param opts [Hash] 构造client时的参数选项
      # @option opts [string] domain [必填] gitea服务地址
      # @option opts [string] base_url [必填] api相对路径
      # @option opts [string] admin_username [必填] 管理员账号
      # @option opts [string] admin_password [必填] 管理员密码
      # @option opts [string] username [选填] 用户账号
      # @option opts [string] password [选填] 用户密码
      # @option opts [string] gitea_token [选填] 用户token
      def initialize(opts)
        @config = Config.new(opts)
        Gitea::Common::Logging.set_log_file(@config.log_filepath)
        @http = Http.new(@config)
      end

      def config 
        @config
      end

      def config=(config)
        unless config.is_a?(Gitea::Api::Config)
          fail Exception, "load config failure!"
        end
        @config = config
        @http = Http.new(config)
      end

      def token 
        @config.token 
      end

      def token=(token)
        @config.token = token 
      end

      include Gitea::Api::Issue
      include Gitea::Api::Repository
      include Gitea::Api::Settings
      include Gitea::Api::User
      include Gitea::Api::Organization
      include Gitea::Api::Notification
      include Gitea::Api::Miscellaneous
      include Gitea::Api::Admin
    end
  end # User
end # Gitea

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
gitea-client-1.6.1 lib/gitea/api/client.rb
gitea-client-1.6.0 lib/gitea/api/client.rb
gitea-client-1.5.9 lib/gitea/api/client.rb
gitea-client-1.5.8 lib/gitea/api/client.rb
gitea-client-1.5.6 lib/gitea/api/client.rb
gitea-client-1.5.0 lib/gitea/api/client.rb
gitea-client-1.4.6 lib/gitea/api/client.rb
gitea-client-1.4.5 lib/gitea/api/client.rb
gitea-client-1.4.4 lib/gitea/api/client.rb
gitea-client-1.4.3 lib/gitea/api/client.rb
gitea-client-1.4.2 lib/gitea/api/client.rb
gitea-client-1.4.1 lib/gitea/api/client.rb
gitea-client-1.4.0 lib/gitea/api/client.rb
gitea-client-1.3.3 lib/gitea/api/client.rb
gitea-client-1.3.2 lib/gitea/api/client.rb
gitea-client-1.3.0 lib/gitea/api/client.rb
gitea-client-1.3.1 lib/gitea/api/client.rb
gitea-client-1.2.2 lib/gitea/api/client.rb
gitea-client-1.2.1 lib/gitea/api/client.rb
gitea-client-1.2.0 lib/gitea/api/client.rb