Skip to content

Commit

Permalink
change module namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Apr 22, 2024
1 parent 528485a commit 62cc488
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 49 deletions.
2 changes: 1 addition & 1 deletion cff/cff.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cff

import "commonmeta/types"
import "github.com/front-matter/commonmeta-go/types"

type Content struct {
ID string `json:"id"`
Expand Down
10 changes: 6 additions & 4 deletions cmd/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ Copyright © 2024 NAME HERE <EMAIL ADDRESS>
package cmd

import (
"commonmeta/crossref"
"commonmeta/datacite"
"commonmeta/doiutils"
"commonmeta/types"
"encoding/json"
"fmt"
"strings"

"github.com/front-matter/commonmeta-go/datacite"
"github.com/front-matter/commonmeta-go/doiutils"
"github.com/front-matter/commonmeta-go/types"

"github.com/front-matter/commonmeta-go/crossref"

"github.com/spf13/cobra"
)

Expand Down
11 changes: 6 additions & 5 deletions cmd/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ package cmd

import (
"bytes"
"commonmeta/commonmeta"
"commonmeta/crossref"
"commonmeta/datacite"
"commonmeta/types"
"encoding/json"
"fmt"

"github.com/front-matter/commonmeta-go/commonmeta"
"github.com/front-matter/commonmeta-go/crossref"
"github.com/front-matter/commonmeta-go/datacite"
"github.com/front-matter/commonmeta-go/types"

"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -63,5 +64,5 @@ var sampleCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(sampleCmd)

sampleCmd.PersistentFlags().StringP("provider", "", "", "the provider to get a sample from")
sampleCmd.PersistentFlags().StringP("provider", "", "crossref", "the provider to get a sample from")
}
2 changes: 1 addition & 1 deletion codemeta/codemeta.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package codemeta

import "commonmeta/types"
import "github.com/front-matter/commonmeta-go/types"

type Content struct {
ID string `json:"id"`
Expand Down
5 changes: 3 additions & 2 deletions commonmeta/commonmeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package commonmeta

import (
"bytes"
"commonmeta/schemautils"
"commonmeta/types"
"encoding/json"
"fmt"

"github.com/front-matter/commonmeta-go/schemautils"
"github.com/front-matter/commonmeta-go/types"

"github.com/xeipuuv/gojsonschema"
)

Expand Down
10 changes: 5 additions & 5 deletions crossref/crossref.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package crossref

import (
"commonmeta/dateutils"
"commonmeta/doiutils"
"commonmeta/types"
"commonmeta/utils"
"encoding/json"
"errors"
"fmt"
Expand All @@ -18,6 +14,11 @@ import (
"strconv"
"strings"
"time"

"github.com/front-matter/commonmeta-go/dateutils"
"github.com/front-matter/commonmeta-go/doiutils"
"github.com/front-matter/commonmeta-go/types"
"github.com/front-matter/commonmeta-go/utils"
)

type Content struct {
Expand Down Expand Up @@ -402,7 +403,6 @@ func ReadCrossref(content Content) (types.Data, error) {
ContributorRoles: []string{"Author"},
Affiliations: affiliations,
})

}
}

Expand Down
7 changes: 4 additions & 3 deletions crossref/crossref_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package crossref_test

import (
"commonmeta/crossref"
"commonmeta/doiutils"
"commonmeta/types"
"encoding/json"
"os"
"path/filepath"
"strings"
"testing"

"github.com/front-matter/commonmeta-go/crossref"
"github.com/front-matter/commonmeta-go/doiutils"
"github.com/front-matter/commonmeta-go/types"

"github.com/google/go-cmp/cmp"
)

Expand Down
2 changes: 1 addition & 1 deletion crossrefxml/crossrefxml.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package crossrefxml

import (
"commonmeta/types"
"github.com/front-matter/commonmeta-go/types"
)

type Content struct {
Expand Down
2 changes: 1 addition & 1 deletion csl/csl.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package csl

import "commonmeta/types"
import "github.com/front-matter/commonmeta-go/types"

type Content struct {
ID string `json:"id"`
Expand Down
9 changes: 5 additions & 4 deletions datacite/datacite.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package datacite

import (
"commonmeta/constants"
"commonmeta/doiutils"
"commonmeta/types"
"commonmeta/utils"
"encoding/json"
"errors"
"fmt"
Expand All @@ -15,6 +11,11 @@ import (
"strconv"
"strings"
"time"

"github.com/front-matter/commonmeta-go/constants"
"github.com/front-matter/commonmeta-go/doiutils"
"github.com/front-matter/commonmeta-go/types"
"github.com/front-matter/commonmeta-go/utils"
)

type Content struct {
Expand Down
7 changes: 4 additions & 3 deletions datacite/datacite_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package datacite_test

import (
"commonmeta/datacite"
"commonmeta/doiutils"
"commonmeta/types"
"encoding/json"
"errors"
"os"
"path/filepath"
"strings"
"testing"

"github.com/front-matter/commonmeta-go/datacite"
"github.com/front-matter/commonmeta-go/doiutils"
"github.com/front-matter/commonmeta-go/types"

"github.com/google/go-cmp/cmp"
)

Expand Down
3 changes: 2 additions & 1 deletion dateutils/dateutils_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package dateutils_test

import (
"commonmeta/dateutils"
"testing"

"github.com/front-matter/commonmeta-go/dateutils"
)

// func TestGetDateParts(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion doiutils/doiutils_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package doiutils_test

import (
"commonmeta/doiutils"
"testing"

"github.com/front-matter/commonmeta-go/doiutils"
)

func TestValidateDOI(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/front-matter/commonmeta
module github.com/front-matter/commonmeta-go

go 1.22.2

Expand Down
3 changes: 2 additions & 1 deletion inveniordm/inveniordm.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package inveniordm

import (
"commonmeta/types"
"encoding/json"
"fmt"
"io"
"net/http"
"time"

"github.com/front-matter/commonmeta-go/types"
)

type Content struct {
Expand Down
3 changes: 2 additions & 1 deletion inveniordm/inveniordm_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package inveniordm_test

import (
"commonmeta/inveniordm"
"testing"

"github.com/front-matter/commonmeta-go/inveniordm"
)

func TestGetInvenioRDM(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion jsonfeed/jsonfeed.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package jsonfeed

import (
"commonmeta/types"
"encoding/json"
"fmt"
"io"
"net/http"
"time"

"github.com/front-matter/commonmeta-go/types"
)

type Content struct {
Expand Down
3 changes: 2 additions & 1 deletion jsonfeed/jsonfeed_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package jsonfeed_test

import (
"commonmeta/jsonfeed"
"testing"

"github.com/front-matter/commonmeta-go/jsonfeed"
)

func TestGetJsonFeedItem(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Front Matter <[email protected]>
package main

import (
"commonmeta/cmd"
"github.com/front-matter/commonmeta-go/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion schemaorg/schemaorg.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package schemaorg

import "commonmeta/types"
import "github.com/front-matter/commonmeta-go/types"

type Content struct {
ID string `json:"id"`
Expand Down
11 changes: 6 additions & 5 deletions schemautils/schemautils_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package schemautils_test

import (
"commonmeta/schemautils"
"commonmeta/types"
"encoding/json"
"path/filepath"

"github.com/front-matter/commonmeta-go/schemautils"
"github.com/front-matter/commonmeta-go/types"

"fmt"
"log"
"os"
Expand Down Expand Up @@ -38,9 +39,9 @@ func TestJSONSchemaErrors(t *testing.T) {
}

testCases := []testCase{
{meta: m, want: 1},
{meta: n, want: 2},
{meta: o, want: 2},
{meta: m, want: 0},
{meta: n, want: 1},
{meta: o, want: 1},
}
for _, tc := range testCases {
documentJSON, err := json.Marshal(tc.meta)
Expand Down
4 changes: 2 additions & 2 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Data struct {
AdditionalType string `db:"additional_type" json:"additionalType,omitempty"`
ArchiveLocations []string `db:"archive_locations" json:"archiveLocations,omitempty"`
Container Container `db:"container" json:"container,omitempty"`
Contributors []Contributor `db:"contributors" json:"contributors"`
Contributors []Contributor `db:"contributors" json:"contributors,omitempty"`
Date Date `db:"date" json:"date,omitempty"`
Descriptions []Description `db:"descriptions" json:"descriptions,omitempty"`
Files []File `db:"files" json:"files,omitempty"`
Expand Down Expand Up @@ -46,7 +46,7 @@ type Container struct {

type Contributor struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
GivenName string `json:"givenName,omitempty"`
FamilyName string `json:"familyName,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion types/types_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package types_test

import (
"commonmeta/types"
"testing"

"github.com/front-matter/commonmeta-go/types"
)

func TestMetadata(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package utils

import (
"commonmeta/doiutils"
"encoding/json"
"fmt"
"log"
"net/url"
"regexp"
"strings"

"github.com/front-matter/commonmeta-go/doiutils"

"github.com/microcosm-cc/bluemonday"
)

Expand Down
3 changes: 2 additions & 1 deletion utils/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package utils_test

import (
"commonmeta/utils"
"testing"

"github.com/front-matter/commonmeta-go/utils"
)

func TestNormalizeUrl(t *testing.T) {
Expand Down

0 comments on commit 62cc488

Please sign in to comment.