filen

package module
v0.0.0-...-ed1a0ea Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigEndpoint   = "https://cdn.filen.io/cfg.json"
	AuthInfoEndpoint = "/v3/auth/info"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

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

func NewAPIClient

func NewAPIClient(httpClient *http.Client) *APIClient

func (*APIClient) AuthInfo

func (c *APIClient) AuthInfo() (*User, error)

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() (*Config, error)

func (*APIClient) SetEndpoints

func (c *APIClient) SetEndpoints(endpoints []string)

type Config

type Config struct {
	Maintenance   bool                 `json:"maintenance"`
	ReadOnly      bool                 `json:"readOnly"`
	Announcements []ConfigAnnouncement `json:"announcements"`
	Pricing       struct {
		LifetimeEnabled bool          `json:"lifetimeEnabled"`
		SaleEnabled     bool          `json:"saleEnabled"`
		Plans           []ConfigPlans `json:"plans"`
	} `json:"pricing"`
}

type ConfigAnnouncement

type ConfigAnnouncement struct {
	UUID      string `json:"uuid"`
	Title     string `json:"title"`
	Message   string `json:"message"`
	Active    bool   `json:"active"`
	Timestamp int    `json:"timestamp"`
}

type ConfigPlanTerm

type ConfigPlanTerm string
const (
	ConfigPlanTermMonthly  ConfigPlanTerm = "monthly"
	ConfigPlanTermAnnually ConfigPlanTerm = "annually"
	ConfigPlanTermLifetime ConfigPlanTerm = "lifetime"
)

type ConfigPlanTermType

type ConfigPlanTermType int
const (
	ConfigPlanTermTypeStarter  ConfigPlanTermType = 1
	ConfigPlanTermTypeMonthly  ConfigPlanTermType = 2
	ConfigPlanTermTypeAnnually ConfigPlanTermType = 3
	ConfigPlanTermTypeLifetime ConfigPlanTermType = 4
)

type ConfigPlans

type ConfigPlans struct {
	TermType int    `json:"termType"`
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Cost     int    `json:"cost"`
	Sale     int    `json:"sale"`
	Storage  int    `json:"storage"`
	Popular  bool   `json:"popular"`
	Term     string `json:"term"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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