clients

package
v0.0.0-...-c12b17c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetReplicatedCustomerResponse

type GetReplicatedCustomerResponse struct {
	ReplicatedEmail string `json:"replicatedEmail"`
	Message         string `json:"message"`
	StatusCode      int    `json:"status_code"`
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type ILicense

type ILicense interface {
	Get(url string) *Request
	Validate(id, licenseServiceUrl string, data *Response) *Request
	GetReplicatedCustomerEmail(licenseId, licenseServiceUrl string, data *Response) *Request
	IsTrial(l string) bool
}

func NewLicenseClient

func NewLicenseClient() ILicense

func NewMockLicenseClient

func NewMockLicenseClient() ILicense

type License

type License struct {
	// contains filtered or unexported fields
}

func (*License) Get

func (c *License) Get(url string) *Request

func (*License) GetReplicatedCustomerEmail

func (c *License) GetReplicatedCustomerEmail(licenseId, licenseServiceUrl string, data *Response) *Request

func (*License) IsTrial

func (c *License) IsTrial(l string) bool

func (*License) Validate

func (c *License) Validate(id, licenseServiceUrl string, data *Response) *Request

type MockClient

type MockClient struct {
	DoFunc func(req *http.Request) (*http.Response, error)
}

func (*MockClient) Do

func (m *MockClient) Do(req *http.Request) (*http.Response, error)

type MockLicense

type MockLicense struct {
	GetFunc                        func(url string) *Request
	ValidateFunc                   func(id, licenseServiceUrl string, data *Response) *Request
	GetReplicatedCustomerEmailFunc func(licenseId, licenseServiceUrl string, data *Response) *Request
	IsTrialFunc                    func(l string) bool
}

func (*MockLicense) Get

func (m *MockLicense) Get(url string) *Request

func (*MockLicense) GetReplicatedCustomerEmail

func (m *MockLicense) GetReplicatedCustomerEmail(licenseId, licenseServiceUrl string, data *Response) *Request

func (*MockLicense) IsTrial

func (m *MockLicense) IsTrial(l string) bool

func (*MockLicense) Validate

func (m *MockLicense) Validate(id, licenseServiceUrl string, data *Response) *Request

type Request

type Request struct {
	Url     string
	Code    int
	Body    []byte
	Message string
	Ok      bool
}

func (*Request) Failure

func (r *Request) Failure(code int, msg string) *Request

func (*Request) ParseData

func (r *Request) ParseData(data RequestDataInterface) *Request

func (*Request) ParseLicenseResp

func (r *Request) ParseLicenseResp(data RequestDataInterface) *Request

func (*Request) Success

func (r *Request) Success() *Request

type RequestDataInterface

type RequestDataInterface interface {
}

type RequestParams

type RequestParams struct {
	LicenseId string
}

type Response

type Response struct {
	Data    bool   //json: "data"
	Message string //json: "message"
	Code    int    //json: "status_code"
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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