<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Chaitanya&#39;s Portfolio</title>
        <link>https://chillygopher.codeberg.page/projects/</link>
        <description>Recent content on Chaitanya&#39;s Portfolio</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-gb</language>
        <lastBuildDate>Thu, 03 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://chillygopher.codeberg.page/projects/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>go-nvd - An Unoffical API Wrapper for nvd.nist.gov APIs</title>
            <link>https://chillygopher.codeberg.page/projects/go-nvd/</link>
            <pubDate>Thu, 03 Sep 2026 00:00:00 +0000</pubDate>
            <guid>https://chillygopher.codeberg.page/projects/go-nvd/</guid>
            <description>&lt;img src=&#34;https://chillygopher.codeberg.page/assets/gonvd-banner.png&#34; alt=&#34;Featured image of post go-nvd - An Unoffical API Wrapper for nvd.nist.gov APIs&#34; /&gt;&lt;h2 id=&#34;project-overview&#34;&gt;&lt;a href=&#34;#project-overview&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Project Overview&#xA;&lt;/h2&gt;&lt;h3 id=&#34;what-is-go-nvd&#34;&gt;&lt;a href=&#34;#what-is-go-nvd&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;What is go-nvd?&#xA;&lt;/h3&gt;&lt;p&gt;go-nvd is an unofficial API wrapper for interacting with the nvd.nist.gov REST APIs.&#xA;The main appeal of the project is the declarative programming style it enables using &lt;code&gt;WithFunctions&lt;/code&gt; and an easy to configure client enables the developer to interact with the NVD without contributing to code complexity.&#xA;This reduces noise and allows developers to focus entirely on how they analyse, modify or otherwise process the response data.&#xA;As an Example, the code to request for 300 CVEs can be as simple and concise as:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;package&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;codeberg.org/chillygopher/go-nvd&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;codeberg.org/chillygopher/go-nvd/cve&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// main fetches a total of 300 CVEs using the resultsPerPage Parameter&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;client&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cve&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;NewClient&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;gonvd&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;WithAPIKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;INSERT-API-KEY&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;resp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;client&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;FilteredFetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cve&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;WithResultsPerPage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;300&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9; &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// handle error&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// use resp as required&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;h3 id=&#34;api-coverage&#34;&gt;&lt;a href=&#34;#api-coverage&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;API Coverage&#xA;&lt;/h3&gt;&lt;p&gt;go-nvd fully supports interacting with both the CVE and CVE History API (and also the Feeds API, but the support for it is rather experimental), with wrappers for the other APIs on their way as the library matures and grows.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-design-philosophy---levering-functional-options&#34;&gt;&lt;a href=&#34;#the-design-philosophy---levering-functional-options&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;The Design Philosophy - Levering Functional Options&#xA;&lt;/h2&gt;&lt;h3 id=&#34;overview&#34;&gt;&lt;a href=&#34;#overview&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Overview&#xA;&lt;/h3&gt;&lt;p&gt;The design philosophy for the go-nvd API revolves heavily around the Client which is used to interact with their respective NVD REST API endpoint, Each Client exposes a handful of helper methods for that specific API Endpoint and more importantly the FilteredFetch Method, Below is the FilteredFetch Method implemented by the cveClient;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cveClient&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;FilteredFetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;FilterOpts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ResponseType&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;h3 id=&#34;fetching-the-information&#34;&gt;&lt;a href=&#34;#fetching-the-information&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Fetching the Information&#xA;&lt;/h3&gt;&lt;p&gt;To fetch the information, the User should primarily use the FilteredFetch method.&#xA;The method expects the user to enter a variable number of types that satisfy the FilterOpts Interface (An Interface can simply be considered as a contract for types, If the types implement the methods for that interface than the type is said to satisfy that Interface).&lt;/p&gt;&#xA;&lt;p&gt;This method follows the &lt;em&gt;Functional Options&lt;/em&gt; design pattern as defined by the Style guide developed by Uber (Find the Entire Guide &lt;a class=&#34;link&#34; href=&#34;https://github.com/uber-go/guide/blob/master/style.md&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;Here&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Functional Options as defined by the Style guide;&lt;/p&gt;&#xA;&#xA;    &lt;blockquote&gt;&#xA;        &lt;p&gt;Functional options is a pattern in which you declare an opaque &lt;code&gt;Option&lt;/code&gt; type that records information in some internal struct. You accept a variadic number of these options and act upon the full information recorded by the options on the internal struct.&lt;/p&gt;&#xA;&lt;p&gt;Use this pattern for optional arguments in constructors and other public APIs that you foresee needing to expand, especially if you already have three or more arguments on those functions.&lt;/p&gt;&#xA;&#xA;    &lt;/blockquote&gt;&#xA;&lt;p&gt;The FilterOpts Interface is;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;FilterOpts&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;interface&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#x9;&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;apply&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;vals&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;Values&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;This enables users to add a variadic number of parameters to their request, which is then applied to the query URL, enabling users to form URL-encoded queries such as;&#xA;&lt;code&gt;https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=300&lt;/code&gt;&#xA;using the function call;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;resp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;client&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;FilteredFetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cve&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;WithResultsPerPage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;300&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;All the parameters for the CVE and CVE History REST APIs are supported, read either the package specification on &lt;a class=&#34;link&#34; href=&#34;https://pkg.go.dev/codeberg.org/chillygopher/go-nvd&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://pkg.go.dev/codeberg.org/chillygopher/go-nvd&lt;/a&gt; or read the API references on the NVD website &lt;a class=&#34;link&#34; href=&#34;https://nvd.nist.gov/developers&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://nvd.nist.gov/developers&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;configuring-the-client&#34;&gt;&lt;a href=&#34;#configuring-the-client&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Configuring the Client&#xA;&lt;/h3&gt;&lt;p&gt;A Client can also be configured using a similar approach, A constructor function for a CVE Client is shown below;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;NewClient&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;gonvd&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ClientOption&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cveClient&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;Possible Configurations allow the client to;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Retry requests when rate limited&lt;/li&gt;&#xA;&lt;li&gt;Apply an API key&lt;/li&gt;&#xA;&lt;li&gt;Apply a Timeout&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;challenges&#34;&gt;&lt;a href=&#34;#challenges&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Challenges&#xA;&lt;/h2&gt;&lt;p&gt;Similarly to most projects, go-nvd has had its fair share of challenges and obstacles, I will briefly mention some of the more prominent challenges I encountered and the solutions I employed.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-retry-riddle&#34;&gt;&lt;a href=&#34;#the-retry-riddle&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;The Retry Riddle&#xA;&lt;/h3&gt;&lt;p&gt;Originally, While Implementing the Retry functionality to retry after being rate limited, I initially intended to use the &lt;code&gt;Retry-After&lt;/code&gt; HTTP Header to determine the amount of time the library waited before retrying, However, after testing with curl, I discovered the NVD doesn&amp;rsquo;t even return a &lt;code&gt;Retry-After&lt;/code&gt; Header when the requests are rate limited!&#xA;This was problematic because this required me to guess how long the client must wait before retrying the request, To address this, the client has been implemented to employ a two-second back off to circumvent users from accidentally spamming the NVD in an intolerable manner.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-newvalue-and-oldvalue-oddities&#34;&gt;&lt;a href=&#34;#the-newvalue-and-oldvalue-oddities&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;The NewValue and OldValue Oddities&#xA;&lt;/h3&gt;&lt;p&gt;For the CVE History API, The NVD returns a Changes object with both NewValue and OldValue fields, Both of these values can be either; a string, an array of strings or a JSON Object, This while being practical for the NVD makes it a nightmare to handle the return type, One Approach may have been to check for all the different changes the NVD could have made and have a go type correspond to the returned type.&lt;/p&gt;&#xA;&lt;p&gt;However, this makes the code complex and therefore twice as hard to maintain and also makes the go-nvd interface seem complex and very challenging for a User using the library.&lt;/p&gt;&#xA;&lt;p&gt;So, to circumvent both these issues, I declare &lt;code&gt;type valueHistory []string&lt;/code&gt;  and implement an &lt;code&gt;UnmarshalJSON&lt;/code&gt; method (Which is automatically called by the json Unmarshal Functions and Decoding Methods), allowing me to store a string, a slice (a slice is a dynamically allocated array) of strings or an object converted to a string, while allowing the user to handle the &lt;code&gt;valueHistory&lt;/code&gt; type like a normal string slice.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-constant-dry-duel&#34;&gt;&lt;a href=&#34;#the-constant-dry-duel&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;The Constant DRY Duel&#xA;&lt;/h3&gt;&lt;p&gt;DRY (Don&amp;rsquo;t Repeat Yourself) is a programming principle, which emphasises that a programmer should try to minimise the amount of code repeated in their library or program. While this is a great concept, It is one that requires one to really put on their engineering cap on, For Example, In the earlier versions of go-nvd (pre-v0.4.0), I repeated a large amount of code for configuring the client and other internal methods which could have easily been shared among the cve and the cvehistory sub-packages, So, In v0.4.0, I refactored this entirely and levereged an embedded Client which held the common configuration for the package, this required me to learn concepts like struct Embedding, Composition and Type scopes in even more detail than I had ever before.&lt;/p&gt;&#xA;&lt;p&gt;While the code still is not perfect, nor completly DRY compliant, it is progressively evolving in a better state as the DRY compliance struggle is a constant one.&lt;/p&gt;&#xA;&lt;h2 id=&#34;my-gains-from-go-nvd&#34;&gt;&lt;a href=&#34;#my-gains-from-go-nvd&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;My Gains from go-nvd&#xA;&lt;/h2&gt;&lt;p&gt;Like all projects, this project has taught me and motivated me to learn a lot more, when I began with this project in June of 2026 I did not have a great grasp on Go code compared to what I know now, and I look forward to learn more while I continue to work on this project while starting others.&#xA;I have learned a large deal about Go design &amp;amp; development, REST API Clients, HTTP, JSON handling, Programming Workflows, Open Source Development and Countless other concepts that I will carry on to other projects.&lt;/p&gt;&#xA;&lt;p&gt;While the project has room for improvement, it is significantly better compared to when I had initially started developing and I am pleased with the progress I have made.&lt;/p&gt;&#xA;&lt;p&gt;Thank you for reading this short project breakdown and review, Hope you have a great day ahead!&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
