apiclient

package module
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2019 License: MIT Imports: 13 Imported by: 1

README

apiclient

Create, Update and Get API Client Details

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add2Ctx added in v0.11.0

func Add2Ctx(ctx context.Context, client *Client) context.Context

Add2Ctx adds the calling API client to the context

func TestDeleteAPIClientHelper added in v0.9.0

func TestDeleteAPIClientHelper(t *testing.T, c Client)

TestDeleteAPIClientHelper creates a client to be used in testing only

Types

type Client

type Client struct {
	ID                 string
	ExtlID             string
	Name               string
	ServerToken        string
	HomeURL            string
	Description        string
	RedirectURI        string
	PrimaryUserID      string
	Secret             string
	CreateClientNumber int
	CreateTimestamp    time.Time
	UpdateClientNumber int
	UpdateTimestamp    time.Time
}

Client is used for the client service and response

func FromCtx added in v0.11.0

func FromCtx(ctx context.Context) (*Client, error)

FromCtx gets the API Client from the context.

func TestAPIClientHelper added in v0.9.0

func TestAPIClientHelper(t *testing.T) *Client

TestAPIClientHelper creates a client to be used in testing only

func (*Client) CreateClientDB

func (c *Client) CreateClientDB(ctx context.Context, log zerolog.Logger, tx *sql.Tx) error

CreateClientDB creates a client/app in the database

func (*Client) Finalize

func (c *Client) Finalize() error

Finalize validates user input and generates token info

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL