Skip to main content

Company

The Company component is a module within the EDK (Eagles Development Kit) that provides functionality related to managing company information. It offers a simple way to import and save company configuration, as well as methods to retrieve company details.

Usage

To use the Company component in your application, follow these steps:

  1. Import the Company Configuration: Import the company configuration from your application's config files or environment variables. The configuration typically includes details such as the company id, url, key, name, and other relevant data. The configuration is encoded in EncodeString function

    // company configuration
    {
    "companies": [
    {
    "full_name": "GamePortal",
    "short_name": "gp",
    "id": "{ID}",
    "key": "{KEY}",
    "url": "{URL}"
    }
    // ...
    ]
    }
  2. Save the Company Configuration: Save the imported company configuration to make it accessible throughout your application.

  3. Retrieve Company Details: Access the company details from anywhere within your application using the provided methods.

Example

    import "gitlab.ugaming.io/marketplace/edk/pkg/client/company"

func main() {
// Load and save the company configuration
data := []byte("{\"companies\":[{\"full_name\":\"GamePortalA\",\"short_name\":\"gpa\",\"id\":\"9b3021b5-e2d7-1234-a2e8-b530a5e90693\",\"key\":\"4be0fbef76ca43ba49aa25d4fc250ad0d35dd3f78a453468ecf86c7b41f11b2e\",\"url\":\"https://gpa.com/payment\"},{\"full_name\":\"GamePortalB\",\"short_name\":\"gpb\",\"id\":\"202d05e6-22f1-49af-85e9-c01ddaf6b99e\",\"key\":\"ec642cb37d6a9b871b567a55d0f12b633fa1bdb3e455d146c0679d2ab162f59a\",\"url\":\"https://gpb.tk/payment\"}]}")

encodedData := EncodeString(string(data))

c, err := company.New(encodedData)
if err != nil {
fmt.Println("new company: ", err)
return
}

// Retrieve other company details as needed
fmt.Print(c.Get())
}

Configuration

The company configuration is typically stored in a YAML file or environment variables. Ensure that the configuration file or environment variables contain the necessary information for your specific company setup.

The configuration should include:

  • full_name: The full name of the company.
  • short_name: The short name of the company.
  • id: It used to identify the company
  • key: It be generated to communicate with the game portal provider
  • url: It be supplied by game portal provider