Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docs and Convention #88

Merged
merged 2 commits into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Key = "your-API-key"
Uiza.Authorization = "your-API-key"
}

```
Expand All @@ -47,7 +47,7 @@ import (

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Key = "your-API-key"
Uiza.Authorization = "your-API-key"

// custom your transport of httpClient
transport := &http.Transport{
Expand Down
8 changes: 5 additions & 3 deletions analytic/client.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package analytic

import (
"github.com/uizaio/api-wrapper-go"
"net/http"

uiza "github.com/uizaio/api-wrapper-go"
)

// Client for analytic
type Client struct {
B uiza.Backend
Key string
Expand All @@ -20,10 +22,10 @@ const (
func getC() Client {
b := uiza.GetBackend(uiza.APIBackend)
b.SetClientType(uiza.AnalyticClientType)
return Client{b, uiza.Key}
return Client{b, uiza.Authorization}
}

// Total Line
// GetTotalLine
func GetTotalLine(params *uiza.AnalyticTotalLineParams) ([]*uiza.AnalyticTotalLineData, error) {
return getC().GetTotalLine(params)
}
Expand Down
5 changes: 3 additions & 2 deletions callback/client.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package callback

import (
"github.com/uizaio/api-wrapper-go"
"net/http"

uiza "github.com/uizaio/api-wrapper-go"
)

type Client struct {
Expand All @@ -17,7 +18,7 @@ const (
func getC() Client {
b := uiza.GetBackend(uiza.APIBackend)
b.SetClientType(uiza.CallbackClientType)
return Client{b, uiza.Key}
return Client{b, uiza.Authorization}
}

func Create(params *uiza.CallbackCreateParams) (*uiza.CallbackData, error) {
Expand Down
5 changes: 3 additions & 2 deletions category/client.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package category

import (
uiza "github.com/uizaio/api-wrapper-go"
"net/http"

uiza "github.com/uizaio/api-wrapper-go"
)

type Client struct {
Expand All @@ -19,7 +20,7 @@ const (
func getC() Client {
b := uiza.GetBackend(uiza.APIBackend)
b.SetClientType(uiza.CategoryClientType)
return Client{b, uiza.Key}
return Client{b, uiza.Authorization}
}

func Retrieve(params *uiza.CategoryIDParams) (*uiza.CategoryData, error) {
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (a *API) Init(key string, backends *uiza.Backends) {
}
}

a.Entity = &entity.Client{B: backends.API, Key: key}
a.Entity = &entity.Client{B: backends.API, Authorization: key}
}

// New creates a new Uiza client with the appropriate secret key
Expand Down
17 changes: 16 additions & 1 deletion docs/ANALYTIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import (
"github.com/uizaio/api-wrapper-go/analytic"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

metric := uiza.AnalyticMetricRebufferCount
params := &uiza.AnalyticTotalLineParams{
StartDate: uiza.String("2018-11-01 08:00"),
Expand All @@ -19,7 +24,7 @@ params := &uiza.AnalyticTotalLineParams{
}

response, _ := analytic.GetTotalLine(params)
for _, v := range response {
for 1_, v := range response {
log.Printf("%v", v.DateTime)
log.Printf("%v", v.RebufferCount)
}
Expand Down Expand Up @@ -48,6 +53,11 @@ import (
"github.com/uizaio/api-wrapper-go/analytic"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

analyticTypeFilter := uiza.AnalyticTypeFilterCountry
params := &uiza.AnalyticTypeParams{
StartDate: uiza.String("2019-01-01"),
Expand Down Expand Up @@ -88,6 +98,11 @@ import (
"github.com/uizaio/api-wrapper-go/analytic"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

rebufferCount := uiza.AnalyticMetricRebufferCount
params := &uiza.AnalyticLineParams{
StartDate: uiza.String("2019-01-01"),
Expand Down
21 changes: 21 additions & 0 deletions docs/CALLBACK.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import (
"github.com/uizaio/api-wrapper-go/callback"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

callbackMethodPOST := uiza.HTTPMethodPost
params := &uiza.CallbackCreateParams{
Url: uiza.String("https://callback-url.uiza.co"),
Expand Down Expand Up @@ -47,6 +52,12 @@ import (
uiza "github.com/uizaio/api-wrapper-go"
"github.com/uizaio/api-wrapper-go/callback"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.CallbackIDParams{ID: uiza.String("Your ID")}
response, _ := callback.Retrieve(params)
log.Printf("%v\n", response)
Expand Down Expand Up @@ -81,6 +92,11 @@ import (
"github.com/uizaio/api-wrapper-go/callback"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

callbackMethodPOST := uiza.HTTPMethodPost
params := &uiza.CallbackUpdateParams{
ID: uiza.String("72d59f91-88c6-458b-9d45-489d2194a09f"),
Expand Down Expand Up @@ -119,6 +135,11 @@ import (
"github.com/uizaio/api-wrapper-go/callback"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.CallbackIDParams{ID: uiza.String("Your ID")}
response, _ := callback.Delete(params)
log.Printf("%v\n", response)
Expand Down
39 changes: 37 additions & 2 deletions docs/CATEGORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import (
"github.com/uizaio/api-wrapper-go/category"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

var typeCategory = uiza.CategoryFolderType
params := &uiza.CategoryCreateParams{
Name: uiza.String("Category name example"),
Expand Down Expand Up @@ -45,6 +50,11 @@ import (
"github.com/uizaio/api-wrapper-go/category"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.CategoryIDParams{ID :uiza.String("Your category ID")}
response, _ := category.Retrieve(params)
log.Printf("%v\n", response)
Expand Down Expand Up @@ -76,6 +86,11 @@ import (
"github.com/uizaio/api-wrapper-go/category"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.CategoryListParams{
Page:uiza.Int64(2),
Limit:uiza.Int64(10),
Expand Down Expand Up @@ -125,7 +140,12 @@ import (
"github.com/uizaio/api-wrapper-go"
"github.com/uizaio/api-wrapper-go/category"
)


func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

var typeCategory = uiza.CategoryFolderType
params := &uiza.CategoryUpdateParams{
ID: uiza.String("Your category ID"),
Expand Down Expand Up @@ -163,6 +183,11 @@ import (
"github.com/uizaio/api-wrapper-go/category"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.CategoryIDParams{ID: uiza.String("Your category ID")}
response, _ := category.Delete(params)
log.Printf("%v", response)
Expand All @@ -183,7 +208,12 @@ import (
"github.com/uizaio/api-wrapper-go"
"github.com/uizaio/api-wrapper-go/category"
)


func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.CategoryRelationParams{
EntityId: uiza.String("16ab25d3-fd0f-4568-8aa0-0339bbfd674f"),
MetadataIds: []*string{
Expand Down Expand Up @@ -221,6 +251,11 @@ import (
"github.com/uizaio/api-wrapper-go/category"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.CategoryRelationParams{
EntityId: uiza.String("16ab25d3-fd0f-4568-8aa0-0339bbfd674f"),
MetadataIds: []*string{
Expand Down
46 changes: 46 additions & 0 deletions docs/ENTITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

var typeHTTP = uiza.InputTypeHTTP
params := &uiza.EntityCreateParams{
Name: uiza.String("Sample Video"),
Expand Down Expand Up @@ -57,6 +62,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.EntityRetrieveParams{ID: uiza.String("Your entity ID")}
response, _ := entity.Retrieve(params)
log.Printf("%s\n", response)
Expand Down Expand Up @@ -93,6 +103,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.EntityListParams{}
listEntity, _ := entity.List(params)
for _, v := range listEntity {
Expand Down Expand Up @@ -153,6 +168,12 @@ import (
uiza "github.com/uizaio/api-wrapper-go"
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.EntityUpdateParams{
ID: uiza.String("Your entity ID"),
Name: uiza.String("Update entity name"),
Expand Down Expand Up @@ -201,6 +222,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.EntityDeleteParams{ID: uiza.String("Your entity ID")}
response, _ := entity.Delete(params)
log.Printf("%v\n", response)
Expand All @@ -224,6 +250,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.EntitySearchParams{Keyword: uiza.String("Sample")}
listEntity, _ := entity.Search(params)
for _, v := range listEntity {
Expand Down Expand Up @@ -294,6 +325,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.EntityPublishParams{ID: uiza.String("Your entity ID")}
response, _ := entity.Publish(params)
log.Printf("%v\n", response)
Expand All @@ -317,6 +353,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

params := &uiza.EntityPublishParams{ID: uiza.String("Your entity ID")}
response, _ := entity.GetStatusPublish(params)
log.Printf("%v\n", response)
Expand All @@ -340,6 +381,11 @@ import (
"github.com/uizaio/api-wrapper-go/entity"
)

func init() {
Uiza.WorkspaceAPIDomain = "your-workspace-api-domain.uiza.co"
Uiza.Authorization = "your-API-key"
}

response, _ := entity.GetAWSUploadKey()
log.Printf("%v\n", response)
```
Expand Down
Loading