Documentation ¶
Index ¶
- Constants
- type APICredentials
- type APISession
- type Administrators
- type AuthenticationService
- type Children
- type ChildrenContent
- type Client
- type CognitoConfig
- type CollaboratorCounts
- type CustomTermsOfService
- type DatasetContent
- type DatasetService
- type Degree
- type GetDatasetResponse
- type GetOrganizationResponse
- type GetOrganizationsResponse
- type IdentityPool
- type ManifestService
- type Orcid
- type Organization
- type OrganizationService
- type Organizations
- type Owners
- type PennsieveTermsOfService
- type Properties
- type PropsWithCategory
- type Publication
- type Role
- type Status
- type SubscriptionState
- type TermsOfService
- type TokenPool
- type User
- type UserOptions
- type UserPool
- type UserService
Constants ¶
View Source
const ( BaseURLV1 = "https://api.pennsieve.io" BaseURLV2 = "https://api2.pennsieve.io" DefaultUploadBucket = "pennsieve-prod-uploads-v2-use1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APICredentials ¶
type APISession ¶
type Administrators ¶
type Administrators struct { UpdatedAt time.Time `json:"updatedAt"` Email string `json:"email"` Degree Degree `json:"degree"` Role Role `json:"role"` URL string `json:"url"` IsSuperAdmin bool `json:"isSuperAdmin"` IsPublisher bool `json:"isPublisher"` IntID int `json:"intId"` Color string `json:"color"` PennsieveTermsOfService PennsieveTermsOfService `json:"pennsieveTermsOfService"` LastName string `json:"lastName"` IsOwner bool `json:"isOwner"` FirstName string `json:"firstName"` ID string `json:"id"` AuthyID int `json:"authyId"` CustomTermsOfService []CustomTermsOfService `json:"customTermsOfService"` MiddleInitial string `json:"middleInitial"` PreferredOrganization string `json:"preferredOrganization"` CreatedAt time.Time `json:"createdAt"` Storage int `json:"storage"` Credential string `json:"credential"` Orcid Orcid `json:"orcid"` }
type AuthenticationService ¶
type AuthenticationService struct { BaseUrl string // BaseUrl is exposed in Auth service as we need to update to check new auth when switching profiles // contains filtered or unexported fields }
func (*AuthenticationService) Authenticate ¶
func (s *AuthenticationService) Authenticate(apiKey string, apiSecret string) (*APISession, error)
func (*AuthenticationService) GetAWSCredsForUser ¶
func (s *AuthenticationService) GetAWSCredsForUser() *cognitoidentity.Credentials
GetAWSCredsForUser returns set of AWS credentials to allow user to upload data to upload bucket
func (*AuthenticationService) ReAuthenticate ¶ added in v0.1.1
func (s *AuthenticationService) ReAuthenticate() (*APISession, error)
ReAuthenticate updates authentication JWT and stores in local DB.
type Children ¶
type Children struct { Content ChildrenContent `json:"content"` Properties []PropsWithCategory `json:"properties"` Children []interface{} `json:"children"` Storage int `json:"storage"` Extension string `json:"extension,omitempty"` }
type ChildrenContent ¶
type ChildrenContent struct { ID string `json:"id"` NodeID string `json:"nodeId"` Name string `json:"name"` PackageType string `json:"packageType"` DatasetID string `json:"datasetId"` DatasetNodeID string `json:"datasetNodeId"` OwnerID int `json:"ownerId"` State string `json:"state"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` IntID int `json:"intId"` DatasetIntID int `json:"datasetIntId"` }
type Client ¶
type Client struct { APISession APISession APICredentials APICredentials AWSCredentials *cognitoidentity.Credentials HTTPClient *http.Client OrganizationNodeId string OrganizationId int UploadBucket string Organization *OrganizationService Authentication *AuthenticationService User *UserService Dataset *DatasetService Manifest *ManifestService }
func (*Client) SetBasePathForServices ¶ added in v0.1.3
type CognitoConfig ¶
type CognitoConfig struct { Region string `json:"region"` UserPool UserPool `json:"userPool"` TokenPool TokenPool `json:"tokenPool"` IdentityPool IdentityPool `json:"identityPool"` }
type CollaboratorCounts ¶
type CustomTermsOfService ¶
type DatasetContent ¶
type DatasetContent struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` State string `json:"state"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` PackageType string `json:"packageType"` DatasetType string `json:"datasetType"` Status string `json:"status"` AutomaticallyProcessPackages bool `json:"automaticallyProcessPackages"` License string `json:"license"` Tags []string `json:"tags"` IntID int `json:"intId"` }
type DatasetService ¶
type DatasetService struct {
// contains filtered or unexported fields
}
func (*DatasetService) Get ¶
func (d *DatasetService) Get(ctx context.Context, id string) (*GetDatasetResponse, error)
Get returns a single dataset by id.
type GetDatasetResponse ¶
type GetDatasetResponse struct { Content DatasetContent `json:"content"` Organization string `json:"organization"` Children []Children `json:"children"` Owner string `json:"owner"` CollaboratorCounts CollaboratorCounts `json:"collaboratorCounts"` Storage int `json:"storage"` Status Status `json:"status"` Publication Publication `json:"publication"` Properties []interface{} `json:"properties"` CanPublish bool `json:"canPublish"` Locked bool `json:"locked"` BannerPresignedURL string `json:"bannerPresignedUrl"` }
type GetOrganizationResponse ¶
type GetOrganizationResponse struct {
Organization Organization `json:"organization"`
}
type GetOrganizationsResponse ¶
type GetOrganizationsResponse struct {
Organizations []Organizations `json:"organizations"`
}
type IdentityPool ¶ added in v1.1.0
type ManifestService ¶ added in v0.1.3
type ManifestService struct {
// contains filtered or unexported fields
}
func (*ManifestService) Create ¶ added in v0.1.3
func (d *ManifestService) Create(ctx context.Context, requestBody manifest.DTO) (*manifest.PostResponse, error)
Get returns a single dataset by id.
type Organization ¶
type Organization struct { Name string `json:"name"` EncryptionKeyID string `json:"encryptionKeyId"` Features []string `json:"features"` IntID int `json:"intId"` Slug string `json:"slug"` ID string `json:"id"` CustomTermsOfService CustomTermsOfService `json:"customTermsOfService"` Storage int `json:"storage"` SubscriptionState SubscriptionState `json:"subscriptionState"` Terms string `json:"terms"` }
type OrganizationService ¶
type OrganizationService struct {
// contains filtered or unexported fields
}
func (*OrganizationService) Get ¶
func (o *OrganizationService) Get(ctx context.Context, id string) (*GetOrganizationResponse, error)
Get returns a single organization by id.
func (*OrganizationService) List ¶
func (o *OrganizationService) List(ctx context.Context) (*GetOrganizationsResponse, error)
List lists all the organizations that the user belongs to.
type Organizations ¶
type Organizations struct { Organization Organization `json:"organization"` IsAdmin bool `json:"isAdmin"` Owners []Owners `json:"owners"` Administrators []Administrators `json:"administrators"` IsOwner bool `json:"isOwner"` }
type Owners ¶
type Owners struct { UpdatedAt time.Time `json:"updatedAt"` Email string `json:"email"` Degree Degree `json:"degree"` Role Role `json:"role"` URL string `json:"url"` IsSuperAdmin bool `json:"isSuperAdmin"` IsPublisher bool `json:"isPublisher"` IntID int `json:"intId"` Color string `json:"color"` PennsieveTermsOfService PennsieveTermsOfService `json:"pennsieveTermsOfService"` LastName string `json:"lastName"` IsOwner bool `json:"isOwner"` FirstName string `json:"firstName"` ID string `json:"id"` AuthyID int `json:"authyId"` CustomTermsOfService []CustomTermsOfService `json:"customTermsOfService"` MiddleInitial string `json:"middleInitial"` PreferredOrganization string `json:"preferredOrganization"` CreatedAt time.Time `json:"createdAt"` Storage int `json:"storage"` Credential string `json:"credential"` Orcid Orcid `json:"orcid"` }
type PennsieveTermsOfService ¶
type PennsieveTermsOfService struct {
Version string `json:"version"`
}
type Properties ¶
type PropsWithCategory ¶
type PropsWithCategory struct { Category string `json:"category"` Properties []Properties `json:"properties"` }
type Publication ¶
type SubscriptionState ¶
type SubscriptionState struct { }
type TermsOfService ¶
type TermsOfService struct {
Version string `json:"version"`
}
type User ¶
type User struct { ID string `json:"id"` Email string `json:"email"` FirstName string `json:"firstName"` MiddleInitial string `json:"middleInitial"` LastName string `json:"lastName"` Degree string `json:"degree"` Credential string `json:"credential"` Color string `json:"color"` URL string `json:"url"` AuthyID int `json:"authyId"` IsSuperAdmin bool `json:"isSuperAdmin"` IsIntegrationUser bool `json:"isIntegrationUser"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` PreferredOrganization string `json:"preferredOrganization"` Orcid Orcid `json:"orcid"` PennsieveTermsOfService TermsOfService `json:"pennsieveTermsOfService"` CustomTermsOfService []interface{} `json:"customTermsOfService"` IntID int `json:"intId"` }
type UserOptions ¶
type UserOptions struct{}
type UserService ¶
type UserService struct { BaseUrl string // contains filtered or unexported fields }
func (*UserService) GetUser ¶
func (c *UserService) GetUser(ctx context.Context, options *UserOptions) (*User, error)
Click to show internal directories.
Click to hide internal directories.